diff options
author | Stefan Giehl <stefan@piwik.org> | 2018-04-23 07:00:49 +0300 |
---|---|---|
committer | Matthieu Aubry <mattab@users.noreply.github.com> | 2018-04-23 07:00:49 +0300 |
commit | 2cdedac6792c99a4652016b513ee597e24868d9b (patch) | |
tree | abafef158505e2fe1ed97ff1abfc78cc1580ee3e /plugins/UserCountryMap/javascripts | |
parent | 72224c194e6f138ddf0ea25c5005c12420beb396 (diff) |
Faster Real Time Maps (#12752)
* do not use min timestamp for realtime map queries if not needed
* remove some unused code
* Plot only the last 7 days rather than last 30 days
Diffstat (limited to 'plugins/UserCountryMap/javascripts')
-rw-r--r-- | plugins/UserCountryMap/javascripts/realtime-map.js | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/plugins/UserCountryMap/javascripts/realtime-map.js b/plugins/UserCountryMap/javascripts/realtime-map.js index 8e1240228c..09396e9bba 100644 --- a/plugins/UserCountryMap/javascripts/realtime-map.js +++ b/plugins/UserCountryMap/javascripts/realtime-map.js @@ -1,10 +1,10 @@ /*! - * Piwik - free/libre analytics platform + * Matomo - free/libre analytics platform * * Real time visitors map * Using Kartograph.js http://kartograph.org/ * - * @link http://piwik.org + * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ @@ -67,28 +67,23 @@ if (clickedMenuIsNotMap) { $('#periodString').show(); initTopControls(); - }; + } }); $('.realTimeMap_overlay').css('top', '0px'); $('.realTimeMap_datetime').css('top', '20px'); }, run: function () { - var debug = 0; - var self = this, config = self.config, _ = config._, map = self.map, - main = $('.RealTimeMap_container', this.$element), - worldTotalVisits = 0, maxVisits = config.maxVisits || 100, changeVisitAlpha = typeof config.changeVisitAlpha === 'undefined' ? true : config.changeVisitAlpha, removeOldVisits = typeof config.removeOldVisits === 'undefined' ? true : config.removeOldVisits, doNotRefreshVisits = typeof config.doNotRefreshVisits === 'undefined' ? false : config.doNotRefreshVisits, enableAnimation = typeof config.enableAnimation === 'undefined' ? true : config.enableAnimation, forceNowValue = typeof config.forceNowValue === 'undefined' ? false : +config.forceNowValue, - width = main.width(), lastTimestamp = -1, lastVisits = [], visitSymbols, @@ -148,7 +143,7 @@ 'referrerTypeName', 'browserIcon', 'operatingSystemIcon', 'countryFlag', 'idVisit', 'actionDetails', 'continentCode', 'actions', 'searches', 'goalConversions', 'visitorId', 'userId'].join(','), - minTimestamp: firstRun ? -1 : lastTimestamp + minTimestamp: firstRun ? 0 : lastTimestamp }); } @@ -347,7 +342,7 @@ /* * this function requests new data from Live.getLastVisitsDetails * and updates the symbols on the map. Then, it sets a timeout - * to call itself after the refresh time set by Piwik + * to call itself after the refresh time set by Matomo * * If firstRun is true, the SymbolGroup is initialized */ @@ -527,8 +522,6 @@ } }); } - var lastVisitId = -1, - lastReport = []; refreshVisits(true); } |