1

I've exported the MBTile file using MBUtil but it wasn't generating all the PNG tiles when I'm creating the Overlay map using OpenLayers. What am I missing?

JCC
  • 13
  • 3
  • I've been testing TileMill, an open source map design studio. I have exported the map (with 10 zoom levels) into MBTile format but somehow it's not generating all the PNG files after the export process using MBUtil. Here's how I'm referencing it using Openlayers: – JCC Apr 11 '11 at 16:58
  • Here's the Openlayers code: var myOverlay1 = new OpenLayers.Layer.TMS("my Overlay World","http://localhost:8888/" {'layername': 'firstProject', 'type':'png'}; myOverlay1.setVisibility(false); myOverlay1.setIsBaseLayer(false); map.addLayers(myOverlay1); – JCC Apr 11 '11 at 17:00
  • In that case, this is more related to TileMill. I suggest you edit your question and add the code there, and change your tags. It will make the question easier to find for people with the right skill. Good luck! – Niklas Wulff Apr 11 '11 at 18:09

1 Answers1

2

Could you clarify this question? Is TileMill not generating the tiles correctly (is it crashing? stalling? any other signs of errors?), or is it completing the MBTiles export and the problem is getting your layer onto a page?

Given the code you posted, you should check to see that http://localhost:8888/1.0.0/firstProject/0/0/0.png (or a higher-number tile if you didn't render zoom level zero) is present. If you've just used mbutil to export the tiles, it's likely that you don't have the 1.0.0 part of that URL around - which is necessary for the TMS layer to work. Just make a directory called 1.0.0 and move firstProject into it if that's the case.

tmcw
  • 11,536
  • 3
  • 36
  • 45
  • It's completing the MBTiles export (using mbutil) but when I'm trying to create the overlay, it is looking for other tiles that were not generated by the export. Also, the export generates a metadata.json file, what is this file for? should I be using this info when creating the overlay? Thanks. – JCC Apr 12 '11 at 19:23
  • Can you right-click on a tile and post the URL? That'd make this easier to debug. – tmcw Apr 12 '11 at 20:56
  • Here's the URL: http://localhost:8888/1.0.0/firstProject/0/38/70.png On my export files I usually have one file (0.png), one subdirectory (0) on the zero (0) zoom level. How do I set the export process (in TileMill) to get more subdirectory levels in zero zoom level or is it done in MBUtil export process? – JCC Apr 12 '11 at 23:24
  • Hmm, that's a bizarre URL. If you could post your full OpenLayers config (on Gist or somewhere), that'd help. There might be a projection problem upstream or something. – tmcw Apr 14 '11 at 14:39
  • Hmm, I'll try this out with the tiles you posted. I tried this out quickly with an existing tileset (world-light) and your code worked correctly - and produced the same kind of url, except with zoom level 7 instead of 0. – tmcw Apr 21 '11 at 16:32
  • Got it: the problem is that you've added the serverResolutions and resolutions array to your baselayer, which seems to work fine, but not to the overlay. Adding them to the overlay fixes the overlay. – tmcw Apr 26 '11 at 20:56