How leaflet js load tiles from file system

Viewed 2106

suppose tiles are store in file system like below image enter image description here

roughly seen this url http://build-failed.blogspot.in/2012/11/zoomable-image-with-leaflet.html

see the code

var map = L.map('map').setView([0, 0], 2);
        L.tileLayer('http://localhost/tiles/eso/0/0/0.png', {
            minZoom: 1,
            maxZoom: 6,
            attribution: 'Testing',
            tms: true
        }).addTo(map);

from the above code it seems that loading tile 0/0/0.png means refer one tile. so my question is how leaflet will load so many tiles because this url http://localhost/tiles/eso/0/0/0.png refer one tile.

the above code is right?

the above code can load bunch of tiles ?

what setView([0, 0], 2); doing ? what is the meaning of 0,0 and 2 what does it mean ?

also tell me what the below code is trying to say

var map = L.map('map').setView([0, 0], 2);
        L.tileLayer('eso/{z}/{x}/{y}.jpg', {
            minZoom: 1,
            maxZoom: 6,
            attribution: 'ESO/INAF-VST/OmegaCAM',
            tms: true
        }).addTo(map);

in the above code we do not mention any value for z or for y or x ?

what approach i need to follow in real life ? do i need to specify value or leaf will provider value for z,y, and x at run time ?

please let me know. thanks

2 Answers
Related