Thomas
Thomas

Reputation: 34208

What Z stand for in leaflet js

i am new in leaflet js. so reading many basic article and write up on this to understand leaflet js.see the code and tell me what is the utility of z ?

L.tileLayer('**http://localhost/tileserver/tile.aspx?z={z}&x={x}&y={y}**', {
    minZoom: 7, maxZoom: 16,
    attribution: 'My Tile Server'
}).addTo(map);

i know z means here zoom but what zoom will be doing in leaflet js ? i have seen a folder is consider as z.

anyone can guide me about z, x and y and tell me why we need to access any image like this way. if possible discuss with example. thanks

Upvotes: 0

Views: 89

Answers (1)

Aron Ambrosiani
Aron Ambrosiani

Reputation: 36

Zoom level 0 shows the entire earth in 256*256 pixels. The next level (z1) needs 512*512 pixels to show the entire earth (4 squares of 256*256 pixels). Every new zoom levels means 4 times the number of tiles needed to show an area.

A more detailed article, "how web maps work", can be found here: https://www.mapbox.com/help/how-web-maps-work/

Upvotes: 1

Related Questions