allow portal highlighters for placeholder portals - several (e.g. uniques) work just fine

fix several other highlighters to check for required data on portals
This commit is contained in:
Jon Atkins
2015-06-28 21:49:02 +01:00
parent bf795e7520
commit 8f1759d7c3
6 changed files with 20 additions and 18 deletions

View File

@ -27,19 +27,22 @@ window.plugin.portalHighlighterInactive = function() {};
window.plugin.portalHighlighterInactive.highlight = function(data) {
var daysUnmodified = (new Date().getTime() - data.portal.options.timestamp) / (24*60*60*1000);
if (data.portal.options.timestamp > 0) {
if (daysUnmodified >= 7) {
var daysUnmodified = (new Date().getTime() - data.portal.options.timestamp) / (24*60*60*1000);
var fill_opacity = Math.min(1,((daysUnmodified-7)/24)*.85 + .15);
if (daysUnmodified >= 7) {
var blue = Math.max(0,Math.min(255,Math.round((daysUnmodified-31)/62*255)));
var fill_opacity = Math.min(1,((daysUnmodified-7)/24)*.85 + .15);
var colour = 'rgb(255,0,'+blue+')';
var blue = Math.max(0,Math.min(255,Math.round((daysUnmodified-31)/62*255)));
var params = {fillColor: colour, fillOpacity: fill_opacity};
var colour = 'rgb(255,0,'+blue+')';
data.portal.setStyle(params);
var params = {fillColor: colour, fillOpacity: fill_opacity};
data.portal.setStyle(params);
}
}
}