Exemple #1
0
        protected virtual void SetGeolocation(Item item, GeocodingGeometryLocation location)
        {
            if (location == null)
            {
                return;
            }

            item.Fields["Latitude"].Value  = location.Latitude.ToString(CultureInfo.InvariantCulture);
            item.Fields["Longitude"].Value = location.Longitude.ToString(CultureInfo.InvariantCulture);
        }
 private static bool LocationIsWithinBounds(GeocodingGeometryLocation location, GeocodingGeometryLocationBounds bounds)
 {
     if (location.Latitude < bounds.Southwest.Latitude)
     {
         return(false);
     }
     if (location.Latitude > bounds.Northeast.Latitude)
     {
         return(false);
     }
     if (location.Longitude < bounds.Southwest.Longitude)
     {
         return(false);
     }
     if (location.Longitude > bounds.Northeast.Longitude)
     {
         return(false);
     }
     return(true);
 }