Use old calculation of city visits in right sidebar on Map page due to performance issues

This commit is contained in:
Eugene Burmakin 2024-06-25 22:42:05 +02:00
parent dc6736942d
commit ad164b0edd
2 changed files with 1 additions and 2 deletions

View file

@ -15,7 +15,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
- Calculation of city visits that are shown in right sidebar on Map page was reworked and now is more accurate.
- Order of points on Points page is now descending by timestamp instead of ascending.
---

View file

@ -6,7 +6,7 @@ class MapController < ApplicationController
def index
@points = current_user.tracked_points.without_raw_data.where('timestamp >= ? AND timestamp <= ?', start_at, end_at).order(timestamp: :asc)
@countries_and_cities = Visits::Calculate.new(@points).uniq_visits
@countries_and_cities = CountriesAndCities.new(@points).call
@coordinates =
@points.pluck(:latitude, :longitude, :battery, :altitude, :timestamp, :velocity, :id)
.map { [_1.to_f, _2.to_f, _3.to_s, _4.to_s, _5.to_s, _6.to_s, _7] }