Esempio n. 1
0
        public double[] GetVisits(string from, string to)
        {
            var dateFrom = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(double.Parse(from)).ToLocalTime();
            var dateTo   = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(double.Parse(to)).ToLocalTime();

            var visits    = AnalyticsHelper.GetVisits(dateFrom, dateTo);
            var dataArray = new double[visits.Count * 4];
            int counter   = 0;

            foreach (var eventData in visits)
            {
                dataArray[counter++] = eventData.Latitude;
                dataArray[counter++] = eventData.Longitude;
                dataArray[counter++] = eventData.Value / 100.0;
                dataArray[counter++] = GetColorIndexByTrafficType(eventData.TrafficType) * 1.0;
            }

            return(dataArray);
        }