A simple example of using OpenLayers V2 with no network connection.
The hard part (for me) was creating an XYZ tileset... but:
Hot tip: use the awesome QTiles plugin for QGIS to easily build tiles sets from raster layers, aka GeoTiffs.
OpenLayers v2 docs are here, but it's essentially just:
var myTilesPath = 'qtiles/bright-earth-tiles/${z}/${x}/${y}.png';
var options = {
projection: "EPSG:3857",
center: center,
zoom: 4,
layers: [
new OpenLayers.Layer.OSM("Local Tiles", myTilesPath)
]
};
var map = new OpenLayers.Map("map", options);