 Posted on Aug. 10, 2023, 10:02 a.m. by Donna Morgan
Category: node.js

All kinds of map downloader to spend money, but too poor to write their own.

Tiles address https://mts1.google.com/vt/lyrs= gl = CNhl = {type} {language} x = {x} y = {} y z = {} z

## Parameters that

• Lyrs = type

• p = terrain
• r = somehow altered roadmap
• s = satellite only
• t = terrain only
• y = hybrid
• GL is the coordinate system

• CN = Chinese Mars coordinate system
• HL = Map Text Language

• Useful - CN = Chinese
• En - US = English
• X is equal to the horizontal of the tile
• Y is equal to the vertical of the tile
• Z = zoom level satellite map 0-14, roadmap 0-17

## Calculate the coordinates of XYZ

Google Maps uses a Mercator projection, just remember that, because you'll need it when you're working with maps.

Assuming that longitude = LNG, latitude = LAT and zoom level is ZOOM at a certain point, then the corresponding tile coordinates are:

``// The total number of tiles in the global map n = 2 ^ zoom; Floor ((LNG + 180.0/360.0) * n); Floor ((LNG + 180.0/360.0) * n); // The current coordinate of the tile is y // -90°~90°, unevenly divided n tangent = Math.tan (Toradians (Lat)); sec = math.sec(toRadians(lat)); y = math.floor((1 - (math.log(tan + sec) / math.pi)) / 2 * n);``