Exemple #1
0
 public static string LocationStr(ILocation loc)
 {
     if (loc != null)
     {
         if (loc.HasCoordinate)
         {
             var coord = loc.GetCoordinate();
             if (coord?.IsValidCoordinate() == true)
             {
                 return(string.Format("pos.{0}_{1}", coord.Latitude, coord.Longitude));
             }
         }
         if (loc.HasAddress)
         {
             return(AdderssStr(loc.GetAddress()));
         }
     }
     return(string.Empty);
 }
Exemple #2
0
        public Location(ILocation location)
        {
            if (location == null)
            {
                return;
            }

            //Landmark = location.Landmark;
            if (location.HasAddress)
            {
                Address = location.GetAddress();
            }

            if (location.HasCoordinate)
            {
                var coord = location.GetCoordinate();
                Coordinate = new Coordinate(coord.Latitude, coord.Longitude);
            }
        }