Skip to content

Commit 5780747

Browse files
author
farah-alyasari
committed
zoom levels and tile grids refreshed
1 parent a513599 commit 5780747

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

articles/azure-maps/zoom-levels-and-tile-grid.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Zoom levels and tile grid | Microsoft Azure Maps
33
description: In this article, you will learn about zoom levels and tile grid in Microsoft Azure Maps.
44
author: jingjing-z
55
ms.author: jinzh
6-
ms.date: 05/07/2018
6+
ms.date: 01/22/2020
77
ms.topic: conceptual
88
ms.service: azure-maps
99
services: azure-maps
@@ -12,12 +12,12 @@ manager:
1212

1313
# Zoom levels and tile grid
1414

15-
Azure Maps use the Spherical Mercator projection coordinate system (EPSG: 3857). A projection is the mathematical model used to transform the spherical globe into a flat map. The Spherical Mercator projection stretches the map at the poles in order to create a square map. This significantly distorts the scale and area of the map but has two important properties that outweigh this distortion:
15+
Azure Maps use the Spherical Mercator projection coordinate system (EPSG: 3857). A projection is the mathematical model used to transform the spherical globe into a flat map. The Spherical Mercator projection stretches the map at the poles to create a square map. This projection significantly distorts the scale and area of the map but has two important properties that outweigh this distortion:
1616

17-
- It's a conformal projection, which means that it preserves the shape of relatively small objects. This is especially important when showing aerial imagery, because we want to avoid distorting the shape of buildings. Square buildings should appear square, not rectangular.
18-
- It's a cylindrical projection, which means that north and south are always straight up and down, and west and east is always straight left and right.
17+
- It's a conformal projection, which means that it preserves the shape of relatively small objects. 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.
18+
- It's a cylindrical projection. North and south are always up and down, and west and east are always left and right.
1919

20-
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. Azure maps provides raster and vector tiles for 23 zoom levels, numbered 0 through 22. At zoom level 0, the entire world fits on a single tile:
20+
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. Azure Maps provides raster and vector tiles for 23 zoom levels, numbered 0 through 22. At zoom level 0, the entire world fits on a single tile:
2121

2222
<center>
2323

@@ -31,7 +31,7 @@ Zoom level 1 uses four tiles to render the world: a 2 x 2 square
3131

3232
Each additional zoom level quad-divides the tiles of the previous one, creating a grid of 2<sup>zoom</sup> x 2<sup>zoom</sup>. Zoom level 22 is a grid 2<sup>22</sup> x 2<sup>22</sup>, or 4,194,304 x 4,194,304 tiles (17,592,186,044,416 tiles in total).
3333

34-
The Azure Maps interactive map controls for web and Android support zoom levels 25 zoom levels, numbered 0 through 24. Although road data will only be available at the zoom levels in when the tiles are available.
34+
The Azure Maps interactive map controls for web and Android support 25 zoom levels, numbered 0 through 24. Although road data will only be available at the zoom levels in when the tiles are available.
3535

3636
The following table provides the full list of values for zoom levels where the tile size is 512 pixels square:
3737

@@ -65,7 +65,7 @@ The following table provides the full list of values for zoom levels where the t
6565

6666
## Pixel coordinates
6767

68-
Having chosen the projection and scale to use at each zoom level, we can convert geographic coordinates into pixel coordinates. The full pixel width and height of a map image of the world for a particular zoom level can be calculated as:
68+
Having chosen the projection and scale to use at each zoom level, we can convert geographic coordinates into pixel coordinates. The full pixel width and height of a map image of the world for a particular zoom level is calculated as:
6969

7070
```javascript
7171
var mapWidth = tileSize * Math.pow(2, zoom);
@@ -77,9 +77,11 @@ Since the map width and height is different at each zoom level, so are the pixel
7777

7878
<center>
7979

80-
![Map showing pixel dimensions](media/zoom-levels-and-tile-grid/map-width-height.png)</center>
80+
![Map showing pixel dimensions](media/zoom-levels-and-tile-grid/map-width-height.png)
8181

82-
Given latitude and longitude in degrees, and the level of detail, the pixel XY coordinates can be calculated as follows:
82+
</center>
83+
84+
Given latitude and longitude in degrees, and the level of detail, the pixel XY coordinates is calculated as follows:
8385

8486
```javascript
8587
var sinLatitude = Math.sin(latitude * Math.PI/180);
@@ -89,11 +91,11 @@ var pixelX = ((longitude + 180) / 360) * tileSize * Math.pow(2, zoom);
8991
var pixelY = (0.5Math.log((1 + sinLatitude) / (1 – sinLatitude)) / (4 * Math.PI)) * tileSize * Math.pow(2, zoom);
9092
```
9193

92-
The latitude and longitude values are assumed to be on the WGS 84 datum. Even though Azure Maps uses a spherical projection, it's important to convert all geographic coordinates into a common datum, and WGS 84 was chosen to be that datum. The longitude value is assumed to range from -180 to +180 degrees, and the latitude value must be clipped to range from -85.05112878 to 85.05112878. This avoids a singularity at the poles, and it causes the projected map to be square.
94+
The latitude and longitude values are assumed to be on the WGS 84 datum. Even though Azure Maps uses a spherical projection, it's important to convert all geographic coordinates into a common datum. WGS 84 is the selected datum. The longitude value is assumed to range from -180 degrees to +180 degrees, and the latitude value must be clipped to range from -85.05112878 to 85.05112878. Adhering to these values avoids a singularity at the poles, and it ensures that the projected map is a squared shape.
9395

9496
## Tile coordinates
9597

96-
To optimize the performance of map retrieval and display, the rendered map is cut into tiles. As the number of pixels differs at each zoom level, so does the number of tiles:
98+
To optimize the performance of map retrieval and display, the rendered map is cut into tiles. The number of pixels and the number of tiles differ at each zoom level:
9799

98100
```javascript
99101
var numberOfTilesWide = Math.pow(2, zoom);
@@ -115,9 +117,9 @@ var tileX = Math.floor(pixelX / tileSize);
115117
var tileY = Math.floor(pixelY / tileSize);
116118
```
117119

118-
Tiles are called by zoom level and the x and y coordinates corresponding to the tile's position on the grid for that zoom level.
120+
Tiles are called by zoom level. The x and y coordinates correspond to the tile's position on the grid for that zoom level.
119121

120-
When determining which zoom level to use, remember each location is in a fixed position on its tile. This means that the number of tiles needed to display a given expanse of territory is dependent on the specific placement of zoom grid on the world. For instance, if there are two points 900 meters apart, it *may* only take three tiles to display a route between them at zoom level 17. However, if the western point is on the right of its tile, and the eastern point on the left of its tile, it may take four tiles:
122+
When determining which zoom level to use, remember each location is in a fixed position on its tile. As a result, the number of tiles needed to display a given expanse of territory is dependent on the specific placement of zoom grid on the world map. For instance, if there are two points 900 meters apart, it *may* only take three tiles to display a route between them at zoom level 17. However, if the western point is on the right of its tile, and the eastern point on the left of its tile, it may take four tiles:
121123

122124
<center>
123125

0 commit comments

Comments
 (0)