--The problem-- I've successfully added mbtiles from Mapbox free online source to OpenLayers, but cannot figure out how to get the mbtiles I've created/stored locally to show up in OpenLayers.
--The process-- Style data in Tilemill, export mbtiles, add mbtiles to Tilestream running on localhost, then add to openlayers using the localhost:8888 url.
--The code--
This works:
// Add mapbox mbtiles from web
map.addLayer(new OpenLayers.Layer.TMS('geography-class',
'http://a.tiles.mapbox.com/mapbox/', {
maxResolution: 156543.0339,
type: 'png',
layername: 'geography-class',
isBaseLayer: true
}));
This doesn't work:
// Add tilestream mbtiles local data layer
map.addLayer(new OpenLayers.Layer.TMS('overlayWorld',
'http://localhost:8888/2.0.0/overlay_62ee43/{z}/{x}/{y}.png', {
maxResolution: 156543.0339,
type: 'png',
layername: 'overlayWorld',
isBaseLayer: false
}));
That localhost url comes from the 'TILE URL' field in Tilestream. I've tried multiple different edits to the localhost url but cannot get it right.
Any help is appreciated.