![]() Preserving the shape of small objects is especially important when showing aerial imagery. For example, we want to avoid distorting the shape of buildings. Square buildings should appear square, not rectangular. ![]() North and south are always up and down, and west and east are always left and right. To optimize the performance of map retrieval and display, the map is divided into square tiles. The Azure Maps SDK's use tiles that have a size of 512 x 512 pixels for road maps, and smaller 256 x 256 pixels for satellite imagery. At zoom level 0, the entire world fits on a single tile: Azure Maps provides raster and vector tiles for 23 zoom levels, numbered 0 through 22. Zoom level 1 uses four tiles to render the world: a 2 x 2 squareĮach additional zoom level quad-divides the tiles of the previous one, creating a grid of 2 zoom x 2 zoom. The Azure Maps interactive map controls for web and Android support 25 zoom levels, numbered 0 through 24. The following table provides the full list of values for zoom levels where the tile size is 512 pixels square at latitude 0: Zoom level Although road data will only be available at the zoom levels in when the tiles are available. The full pixel width and height of a map image of the world for a particular zoom level is calculated as: var mapWidth = tileSize * Math.pow(2, zoom) Having chosen the projection and scale to use at each zoom level, we can convert geographic coordinates into pixel coordinates. ![]() Since the map width and height is different at each zoom level, so are the pixel coordinates. The pixel at the upper-left corner of the map always has pixel coordinates (0, 0). Given latitude and longitude in degrees, and the level of detail, the pixel XY coordinates is calculated as follows: var sinLatitude = Math.sin(latitude * Math.PI/180) For example, when using 512 square tiles at level 2, the pixel coordinates range from (0, 0) to (2047, 2047), like this: The pixel at the lower-right corner of the map has pixel coordinates (width-1, height-1), or referring to the equations in the previous section, (tileSize * 2 zoom–1, tileSize * 2 zoom–1). ![]()
0 Comments
Leave a Reply. |