diff --git a/core/code/map_data_render.js b/core/code/map_data_render.js index 483cdb6a5..e4f236609 100644 --- a/core/code/map_data_render.js +++ b/core/code/map_data_render.js @@ -347,7 +347,10 @@ window.Render.prototype.createPortalEntity = function(ent, details) { // in case of incomplete data while having fresh details in cache, update the portal with those details if (portalDetail.isFresh(guid)) { var oldDetails = portalDetail.get(guid); - if (marker.willUpdate(oldDetails)) + if (data.timestamp > oldDetails.timestamp) { + // data is more recent than the cached details so we remove them from the cache + portalDetail.remove(guid); + } else if (marker.willUpdate(oldDetails)) marker.updateDetails(oldDetails); } diff --git a/core/code/portal_detail.js b/core/code/portal_detail.js index cfb3bc12f..0a12bdd3c 100644 --- a/core/code/portal_detail.js +++ b/core/code/portal_detail.js @@ -25,6 +25,9 @@ window.portalDetail.isFresh = function(guid) { return cache.isFresh(guid); } +window.portalDetail.remove = function(guid) { + return cache.remove(guid); +} var handleResponse = function(deferred, guid, data, success) { if (!data || data.error || !data.result) {