From 5e4e8fee6bc489dd4978047092a473564bb7c9ca Mon Sep 17 00:00:00 2001 From: Jon Atkins Date: Wed, 22 May 2013 14:31:08 +0100 Subject: [PATCH] portals list plugin only includes portals in the view - to match portals-count --- plugins/portals-list.user.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/portals-list.user.js b/plugins/portals-list.user.js index 5fe38471..7f5f0b65 100644 --- a/plugins/portals-list.user.js +++ b/plugins/portals-list.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @id iitc-plugin-portals-list@teo96 // @name IITC plugin: show list of portals -// @version 0.0.12.@@DATETIMEVERSION@@ +// @version 0.0.13.@@DATETIMEVERSION@@ // @namespace https://github.com/jonatkins/ingress-intel-total-conversion // @updateURL @@UPDATEURL@@ // @downloadURL @@DOWNLOADURL@@ @@ -54,9 +54,13 @@ window.plugin.portalslist.getPortals = function() { //console.log('** getPortals'); var retval=false; + var displayBounds = map.getBounds(); + window.plugin.portalslist.listPortals = []; //get portals informations from IITC $.each(window.portals, function(i, portal) { + // eliminate offscreen portals (selected, and in padding) + if(!displayBounds.contains(portal.getLatLng())) return true; retval=true; var d = portal.options.details;