public void MapPoints_HasOneItem_Test()
        {
            MapPoints target = new MapPoints();

            target.Add(new MapPoint()
            {
                Lat = 1, Lon = 2, Name = "test Name"
            });
            Assert.AreEqual(1, target.Count);
        }
Example #2
0
        void ReleaseDesignerOutlets()
        {
            if (ButtonCheck != null)
            {
                ButtonCheck.Dispose();
                ButtonCheck = null;
            }

            if (ButtonClose != null)
            {
                ButtonClose.Dispose();
                ButtonClose = null;
            }

            if (ConstTopText != null)
            {
                ConstTopText.Dispose();
                ConstTopText = null;
            }

            if (LableStatus != null)
            {
                LableStatus.Dispose();
                LableStatus = null;
            }

            if (MapPoints != null)
            {
                MapPoints.Dispose();
                MapPoints = null;
            }

            if (TablePoints != null)
            {
                TablePoints.Dispose();
                TablePoints = null;
            }

            if (TextCode != null)
            {
                TextCode.Dispose();
                TextCode = null;
            }

            if (ViewStatus != null)
            {
                ViewStatus.Dispose();
                ViewStatus = null;
            }
        }
Example #3
0
        public void SetMarkers(List <ServicePoint> points)
        {
            SetNavBar("List");
            TablePoints.Alpha = 0;
            MapPoints.Alpha   = 1;
            var mapDelegate = new MapDelegate(points, this);            //stores, this, owner);

            MapPoints.Delegate = mapDelegate;
            MapPoints.RemoveAnnotations(MapPoints.Annotations);
            if (points != null)
            {
                var annotations = new List <StoreAnnotation>();
                foreach (var st in points)
                {
                    annotations.Add(new StoreAnnotation($"{st.Street} {st.StreetNumber}", new CLLocationCoordinate2D(st.Lat, st.Lon), st));
                    MapPoints.AddAnnotations(new StoreAnnotation($"{st.Street} {st.StreetNumber}", new CLLocationCoordinate2D(st.Lat, st.Lon), st));
                }
                ;
            }
        }
Example #4
0
        public override void InitFullEventData(JObject json)
        {
            base.InitFullEventData(json);

            dynamic fullEvent = (dynamic)json;

            foreach (dynamic sequenceData in fullEvent.value[0].Sequences)
            {
                Sequences.Add(new RunEventSequenceItem(sequenceData));
            }

            // parse out map points
            foreach (dynamic mapData in fullEvent.value[0].MapPoints)
            {
                var runMapPoint = new RunMapPoint()
                {
                    Type = mapData.MapPointType,
                    SecondsSinceStart = mapData.SecondsSinceStart,
                    Ordinal           = mapData.MapPointOrdinal,
                    Distance          = mapData.TotalDistance,
                    HeartRate         = mapData.HeartRate,
                    Pace       = ((double)mapData.Pace * 0.001),
                    ScaledPace = mapData.ScaledPace,
                    IsPaused   = mapData.IsPaused,
                    IsResume   = mapData.IsResume
                };

                if (mapData.Location != null)
                {
                    runMapPoint.Latitude  = ((double)mapData.Location.Latitude * 1E-07);
                    runMapPoint.Longitude = ((double)mapData.Location.Longitude * 1E-07);
                    runMapPoint.Altitude  = ((double)mapData.Location.AltitudeFromMSL * 0.01);
                    runMapPoint.EHPE      = ((double)mapData.Location.EHPE * 0.01);
                    runMapPoint.EVPE      = ((double)mapData.Location.EVPE * 0.01);

                    HasGPSPoints = true;
                }

                MapPoints.Add(runMapPoint);
            }
        }
 public void MapPoints_HasOneItem_Test()
 {
     MapPoints target = new MapPoints();
     target.Add(new MapPoint() { Lat = 1, Lon = 2, Name = "test Name" });
     Assert.AreEqual(1, target.Count);
 }
 public void MapPoints_HasNoItems_Test()
 {
     MapPoints target = new MapPoints();
     Assert.AreEqual(0, target.Count);
 }
Example #7
0
 void Start()
 {
     m_line = this.GetComponent <LineRenderer>();
     m_map  = FindObjectOfType <MapPoints>();
 }
 private void SaveNewPoint()
 {
     MapPoints.Add(CurrentMapPoint);
     GoToPointList();
 }
        public void MapPoints_HasNoItems_Test()
        {
            MapPoints target = new MapPoints();

            Assert.AreEqual(0, target.Count);
        }
Example #10
0
        public async Task <ActionResult> Index(string city2, string cityLat, string cityLng)
        {
            string radius;

            if (Session["rangevalue"] == null)
            {
                radius = "1000";
            }
            else
            {
                radius = (string)Session["rangevalue"];
            }

            if (cityLat == null || cityLng == null)
            {
                if (Session["sessionlat"] == null || Session["sessionlng"] == null)
                {
                    cityLat = "63.8181";
                    cityLng = "20.3073";
                }
                else
                {
                    cityLat = (string)Session["sessionlat"];
                    cityLng = (string)Session["sessionlng"];
                }
            }
            else
            {
                Session["sessionlat"]  = cityLat;
                Session["sessionlng"]  = cityLng;
                Session["sessioncity"] = city2;
            }

            PointJSON unfilteredList = await service.GetPoints(cityLat, cityLng, radius, new List <string>());

            PointJSON pointsList = GetFilteredList(unfilteredList);

            MapPoints mapPoints = new MapPoints(pointsList.resources.Count);

            int counter = 0;

            foreach (var item in pointsList.resources)
            {
                mapPoints.Features[counter].Geometry.Type           = "Point";
                mapPoints.Features[counter].Geometry.Coordinates[0] = float.Parse(item.Location.Longitude, CultureInfo.InvariantCulture);
                mapPoints.Features[counter].Geometry.Coordinates[1] = float.Parse(item.Location.Latitude, CultureInfo.InvariantCulture);
                mapPoints.Features[counter].Type = "Feature";
                if (item.Tags != null && item.Tags.Count >= 3 &&
                    item.Tags[0] != null && item.Tags[1] != null && item.Tags[2] != null &&
                    (item.Tags[0] == "Orange" || item.Tags[0] == "Blue"))
                {
                    mapPoints.Features[counter].Properties.Category = item.Tags[0] + item.Tags[1] + item.Tags[2];
                    createImage(item.Tags[0], item.Tags[1], item.Tags[2]);
                }
                else
                {
                    mapPoints.Features[counter].Properties.Category = "Gray";
                }
                mapPoints.Features[counter].Properties.Hours       = "N/A";
                mapPoints.Features[counter].Properties.Description = ((item.Description != null) ? item.Description.ToString() : "N/A");
                mapPoints.Features[counter].Properties.Name        = ((item.Title != null) ? item.Title.ToString() : "N/A");
                mapPoints.Features[counter].Properties.Phone       = "N/A";
                counter++;
            }

            string jsonString = JsonConvert.SerializeObject(mapPoints);

            ViewBag.Lat    = cityLat;
            ViewBag.Lng    = cityLng;
            ViewBag.Radius = radius;

            return(View("Index", model: jsonString));
        }