Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been stuck on how to use my local tiles which i rendered with mapnik's and all the data is on postgresql. I'm kinda confused on what i should do to "feed" the tiles to openlayers. The map would be used in django btw. hoping you could help me with this.

share|improve this question
up vote 2 down vote accepted

Working on Windows, I have simple duplicated the call of Openstreetmap Tiles, and exchanged the web http access by a link within the local file system:

    var MyMapnikLayer = new OpenLayers.Layer.OSM("myMapnik", "file:///D:/Tiles/myMapnik/${z}/${x}/${y}.png", {numZoomLevels: 16, alpha: true, isBaseLayer: true, visibility: false});
share|improve this answer
thanks. but i get confused with how it displays the tiles since i used the and the output of the script is numerous folders categorized by their zoom levels – iamjoanel Feb 6 '13 at 23:51
These folders are just the same structure as defined by D:/Tiles/myMapnik/${z}/${y}/. In my, I give this command : try: tile_dir = 'D:/Tiles/myMapnik/' (in two lines) – AndreJ Feb 7 '13 at 7:27

You will want to use OpenLayers.Layer.TMS.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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