示例#1
0
        public static List<Models.Location> SlimLocations(List<Models.Location> inList)
        {
            int Interval = inList.Count / (LocationHelper.maxLocations - 2);

            if (Interval < 2)
            {
                Interval = 2;
            }
            List<Models.Location> outList = new List<Models.Location>();

            for (int i = 0; i < inList.Count; i += Interval)
            {
                outList.Add(inList[i]);
            }

            //always add the last value - map always updated then plus other things rely on it!
            outList.Add(inList.Last());

            return outList;
        }