Portal DB
A local portal database plugin for IITC on Niantic's Ingress Intel Map.
Portal DB passively collects portal records while you browse the Intel Map, stores them in IndexedDB, detects moved portals, and gives other IITC plugins a dependable source of portal coordinates and team state.
View this plugin directory on GitHub | See all IITC plugins
Who This Plugin Is For
Portal DB is mainly useful for agents and plugin authors who need a durable local record of portals that are not currently visible on screen. It is especially valuable for workflows that depend on portal history, moved portal detection, or reliable background data for planning and analysis.
Key Features
- Persistent local storage: Uses IndexedDB to store portal GUID, coordinates, team, and last-seen time across browser sessions.
- Passive data collection: Builds the database automatically while you browse the Ingress Intel Map, without requiring manual input.
- Portal move detection: Records old and new positions when a portal shifts by more than 3 meters, which helps identify tactical map changes.
- Visual alerts: Highlights the Portal DB toolbox entry when new moved portals are detected.
- Update statistics: Tracks why data was written or skipped, which is useful for debugging and performance review.
How It Works
The plugin intercepts raw entity data from the Intel Map and turns it into a local portal record set. Other plugins can then use this persistent layer as a portal lookup service, even when the requested portal is outside the current viewport.
This makes Portal DB a backend-style utility inside the IITC ecosystem rather than only a standalone visual tool.
API Reference
Portal DB exposes its functionality through window.plugin.portalDB. All access methods are asynchronous and return a Promise.
getPortal(guid)
Retrieves one portal record by GUID.
// Example: Check if a portal exists and log its coordinates
window.plugin.portalDB.getPortal('your-portal-guid')
.then(portal => {
if (portal) {
console.log(`Found: ${portal.latE6}, ${portal.lngE6}`);
} else {
console.log('Portal not found in local DB');
}
});
getPortalsInBounds(bounds)
Retrieves all stored portals inside a map boundary.
// Example: Find all stored portals in the current map view
const bounds = map.getBounds(); // Leaflet LatLngBounds
window.plugin.portalDB.getPortalsInBounds(bounds)
.then(results => {
console.log(`Found ${results.length} portals in this area.`);
results.forEach(p => console.log(p.guid, p.team));
});
Return Object Structure
Methods return portal objects in the following standardized format:
{
"guid": "...",
"latE6": 35689500,
"lngE6": 139691700,
"team": "E",
"lastSeen": 1707000000
}
How to Use Portal DB
- Browse the Intel Map normally and let the plugin collect portal data in the background.
- Open the Portal DB toolbox entry when you want to inspect moved portals or review stored data.
- Use the Export and Import actions to back up or transfer your local database.
- If you build other IITC tools, call the exposed API methods to query portals outside the current viewport.
Note for developers: If your IITC plugin needs to answer “where is this portal?” for a GUID that is not currently rendered, Portal DB is the recommended local data source.
FAQ
- Does Portal DB work only on screen-visible portals? No. It collects data while you browse, then keeps those records locally so they remain useful even when the portals are no longer visible.
- Why is moved portal detection important? Portal movement can affect links, block links, and planning assumptions. Detecting those shifts helps agents and tools keep map intelligence accurate.
- Is this plugin mainly for users or developers? Both. Agents can use the UI for moved portal review, while developers can use the API as a persistent portal data layer.
Related Plugins
Changelog
Version 0.3.0
- Added portal move detection for shifts greater than 3 meters.
- Added toolbox visual alerts for newly detected moved portals.
- Added a moved portal dashboard with history and jump-to-location support.
Version 0.2.0
- Added hourly bucket statistics for database updates.
- Added persistent stats storage with localStorage.
- Added a real-time statistics dashboard.
Version 0.1.2
- Added an update threshold mechanism to reduce unnecessary writes and I/O.