Il file html

<html><head><title>OSMLocalTiles</title><linkrel="stylesheet"href="style.css"type="text/css"/><!--bringintheOpenLayersjavascriptlibrary(herewebringitfromtheremotesite,butyoucouldeasilyserveupthisjavascriptyourself)--><scriptsrc="http://www.openlayers.org/api/OpenLayers.js"></script><!--bringintheOpenStreetMapOpenLayerslayers.Usingthishostedfilewillmakesurewearekeptuptodatewithanynecessarychanges--><scriptsrc="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script><scripttype="text/javascript">// Start position for the map (hardcoded here for simplicity)varlat=47.7;varlon=7.5;varzoom=10;varmap;//complex object of type OpenLayers.Map//Initialise the 'map' objectfunctioninit(){map=newOpenLayers.Map("map",{controls:[newOpenLayers.Control.Navigation(),newOpenLayers.Control.PanZoomBar(),newOpenLayers.Control.Permalink(),newOpenLayers.Control.ScaleLine({geodesic:true}),newOpenLayers.Control.Permalink('permalink'),newOpenLayers.Control.MousePosition(),newOpenLayers.Control.Attribution()],maxExtent:newOpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),maxResolution:156543.0339,numZoomLevels:19,units:'m',projection:newOpenLayers.Projection("EPSG:900913"),displayProjection:newOpenLayers.Projection("EPSG:4326")});layerMapnik=newOpenLayers.Layer.OSM.Mapnik("Mapnik");layerMapnik.setOpacity(0.4);map.addLayer(layerMapnik);layerCycleMap=newOpenLayers.Layer.OSM.CycleMap("CycleMap");layerCycleMap.setOpacity(0.4);map.addLayer(layerCycleMap);// This is the layer that uses the locally stored tilesvarnewLayer=newOpenLayers.Layer.OSM("Local Tiles","tiles/${z}/${x}/${y}.png",{numZoomLevels:19,alpha:true,isBaseLayer:false});map.addLayer(newLayer);// This is the end of the layervarswitcherControl=newOpenLayers.Control.LayerSwitcher();map.addControl(switcherControl);switcherControl.maximizeControl();if(!map.getCenter()){varlonLat=newOpenLayers.LonLat(lon,lat).transform(newOpenLayers.Projection("EPSG:4326"),map.getProjectionObject());map.setCenter(lonLat,zoom);}}</script></head><!--body.onloadiscalledoncethepageisloaded(callthe'init'function)--><bodyonload="init();"><!--defineaDIVintowhichthemapwillappear.Makeittakeupthewholewindow--><divstyle="width:100%; height:100%"id="map"></div></body></html>