for few days i have been working on developing my own osm tile server. I tried it on linux as well as on windows, no complete success till now.

I Have to make tile server on both windows and linux.

for windows i used Maperitive and succeeded in generating tiles and then i used this guys code


now the prob is tiles are not showing up

Do i need to instal some Apache module for it ? My tiles are kept here


Where as i am opening html file from server


which is kept in here


     <div style="width: 600px; height: 400px" id="map"></div>
      <script src="leaflet/leaflet.js"></script>
      <script type="text/javascript" src="leaflet/leaflet-src.js"></script>
    map = new L.Map('map');

// create the tile layer with correct attribution
var osmUrl='C:\Profiles\Maperitive\TilesMaperitive\Tiles\{z}\{x}\{y}.png';
var osmAttrib='Map data © OpenStreetMap contributors';
var osm = new L.TileLayer(osmUrl, {minZoom: 13, maxZoom: 16, attribution: osmAttrib});      

// start the map in South-East England
map.setView(new L.LatLng(73.054519,33.707173 ),13);
    var popup = L.popup();

    function onMapClick(e) {
            .setContent("You clicked the map at " + e.latlng.toString())

    map.on('click', onMapClick);


1 Answer 1


No, you don't need a special apache module. You don't even need a webserver at all because you can just to open file:///C:/Profiles/ApachePHP/apache/www/mwork/maperitive_test1/index_leaf.html in your browser.

The problem is your osmUrl. Either you have to make C:\Profiles\Maperitive\Tiles available through your webserver. Or you have to replace the URL with file:///C:/Profiles/Maperitive/Tiles/{z}/{x}/{y}.png.

Additionally there is a typo in your URL, Maperitive\TilesMaperitive\Tiles should probably just be Maperitive\Tiles instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.