title: Leaflet.js - Using custom map server
body: <p>I've been trying to embed a custom map, of which the tiles are hosted on my local server and is rendered by Leaflet.js. However, I'm having some difficulty in displaying the map on my html page. Here is the screenshot: <img src="https://i.stack.imgur.com/KWYEx.png" alt="enter image description here"> </p>
  
  <p>this is a "supposed" picture of my country Philippines on zoom 10 but was displayed like that. Also, the map tiles are generated using Maperitive. Hope anyone can help me here. This is my code.</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;title&gt;Offline Map Example&lt;/title&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="../js/leaflet.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="../js/jquery-1.10.2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="../js/jquery-ui-1.10.4.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript"&gt;
  $("#document").ready(function() {
      var map = L.map('map', {
          minZoom: 10,
          maxZoom: 14,
          zoom: 10,
          center: [11.5326,122.7457]
      });
  
      L.tileLayer('http://localhost/Tiles/{z}/{x}/{y}.png', {
          attribution: 'Map data &amp;copy; &lt;a     href="http://openstreetmap.org"&gt;OpenStreetMap&lt;/a&gt; contributors, &lt;a href="http://creativecommons.org/licenses/by-sa/2.0/"&gt;CC-BY-SA&lt;/a&gt;, Imagery © &lt;a href="http://mapbox.com"&gt;Mapbox&lt;/a&gt;',
      }).addTo(map);
  
      var southWest = L.LatLng(4.22816513512253, 116.389103446625),
      northEast = L.LatLng(21.6156671213737, 126.979526808346),
      bounds = L.LatLngBounds(southWest, northEast);
      map.setMaxBounds(bounds); 
  
  }); 
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
     &lt;div id="map" name="map" style="height: 440px; border: 1px solid #AAA;"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/O7ybA.png" alt="enter image description here"></p>
  
  <p>Many thanks guys :)</p>