diff --git a/plugins/portal-counts.user.js b/plugins/portal-counts.user.js index 47fb7ae6..60a41ec9 100644 --- a/plugins/portal-counts.user.js +++ b/plugins/portal-counts.user.js @@ -44,7 +44,7 @@ window.plugin.portalcounts = { }; //count portals for each level available on the map -window.plugin.portalcounts.getPortals = function(){ +window.plugin.portalcounts.getPortals = function (){ //console.log('** getPortals'); var self = window.plugin.portalcounts; var displayBounds = map.getBounds(); @@ -104,7 +104,7 @@ window.plugin.portalcounts.getPortals = function(){ counts += self.neuP; counts += ''; - var svg = $('').css("padding-top", 10); + var svg = $('').css("margin-top", 10); var all = self.PortalsRes.map(function(val,i){return val+self.PortalsEnl[i]}); all[0] = self.neuP; @@ -177,10 +177,9 @@ window.plugin.portalcounts.getPortals = function(){ .appendTo(g); } - counts += svg[0].outerHTML; + counts += $("
").append(svg).html(); } else counts += '

No Portals in range!

'; - counts += ''; var total = self.enlP + self.resP + self.neuP; var title = total + ' ' + (total == 1 ? 'portal' : 'portals'); @@ -248,6 +247,10 @@ window.plugin.portalcounts.makePie = function(startAngle, endAngle, color) { var p2x = Math.sin(endAngle * 2 * Math.PI) * self.RADIUS_INNER; var p2y = Math.cos(endAngle * 2 * Math.PI) * self.RADIUS_INNER; + // for a full circle, both coordinates would be identical, so no circle would be drawn + if(startAngle == 0.5 && endAngle == -0.5) + p2x -= 1E-5; + return $("") .attr({ fill: color, @@ -271,6 +274,12 @@ window.plugin.portalcounts.makeRing = function(startAngle, endAngle, color) { var p4x = Math.sin(startAngle * 2 * Math.PI) * self.RADIUS_INNER; var p4y = Math.cos(startAngle * 2 * Math.PI) * self.RADIUS_INNER; + // for a full circle, both coordinates would be identical, so no circle would be drawn + if(startAngle == 0.5 && endAngle == -0.5) { + p2x -= 1E-5; + p3x -= 1E-5; + } + return $("") .attr({ fill: color, @@ -306,7 +315,7 @@ var setup = function() { } $('head').append('