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
Methods
-
inner 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.
-
inner getMapZoomTileParameters(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.
-
inner setupDataTileParams()
-
Sets up the data tile parameters used for map data requests. This function initializes the TILE_PARAMS global object with default values or values detected from the stock Intel map.