IITC.map.tiles

Contains functions for calculating map data request parameters and converting between lat/lng and map tiles. Ingress Intel splits up requests for map data (portals, links, fields) into tiles. To get data for the current viewport (i.e. what is currently visible) it first calculates which tiles intersect. For all those tiles, it then calculates the lat/lng bounds of that tile and a quadkey. Both the bounds and the quadkey are “somewhat” required to get complete data. Conversion functions courtesy of wiki.openstreetmap.org/wiki/Slippy_map_tilenames

Members

static tileParamsWarningTemplate :String

Warning dialog shown when the stock tile parameters cannot be detected

Methods

static getDataZoomForMapZoom(zoom) → {number}

Determines the data zoom level for a given map zoom level. This function adjusts the zoom level for data requests based on various factors to optimize caching performance and server load.

Parameters:
Name Type Description
zoom number

The current map zoom level.

Returns:
number -

The adjusted zoom level for data requests.

static getMapZoomParameters(zoom) → {Object}

Gets the map zoom tile parameters for a specific zoom level. It calculates the tile level, number of tiles per edge, minimum link length, and whether portals are available at the specified zoom level.

Parameters:
Name Type Description
zoom number

The map zoom level.

Returns:
Object -

An object containing tile parameters for the given zoom level.

static setupParams()

Sets up the data tile parameters used for map data requests. This function initializes the params object with default values or values detected from the stock Intel map.