Esempio n. 1
0
            public VEMapControl(VEMap field)
                : base()
            {
                father  = field;
                this.ID = String.IsNullOrEmpty(father.Name) ? "_VEMap" : father.Name;

                if (father.latitude != null)
                {
                    latitude = father.latitude;
                }
                if (father.longitude != null)
                {
                    longitude = father.longitude;
                }
            }
Esempio n. 2
0
        public static IntBox Distance(VEMap map1, VEMap map2)
        {
            double lat1 = 0, lon1 = 0, lat2 = 0, lon2 = 0, dist = 0;

            if (!double.TryParse(map1.latitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else if (!double.TryParse(map1.longitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else if (!double.TryParse(map2.latitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else if (!double.TryParse(map2.longitude, out lat1))
            {
                dist = double.PositiveInfinity;
            }
            else
            {
                dist = distance(lat1, lon1, lat2, lon2);
            }

            XmlDocument doc       = new XmlDocument();
            XmlNode     nodeValue = doc.CreateElement("null");

            nodeValue.AppendChild(doc.CreateElement("Value"));
            nodeValue.FirstChild.InnerText = dist.ToString();

            IntBox         result  = new IntBox();
            List <XmlNode> listres = new List <XmlNode>();

            listres.Add(nodeValue);
            result.SetValue(listres);


            return(result);
        }
Esempio n. 3
0
 public static bool Souther(VEMap map1, VEMap map2)
 {
     return(double.Parse(map1.latitude) < double.Parse(map2.latitude));
 }
Esempio n. 4
0
 public static bool Equals(VEMap map1, VEMap map2)
 {
     return(map1.latitude.Equals(map2.latitude) && map1.longitude.Equals(map2.longitude));
 }