https://github.com/danwild/ol2-offline
A simple example of using OpenLayers V2 with no network connection.
https://github.com/danwild/ol2-offline
openlayers2 qgis tilesets
Last synced: 3 months ago
JSON representation
A simple example of using OpenLayers V2 with no network connection.
- Host: GitHub
- URL: https://github.com/danwild/ol2-offline
- Owner: danwild
- License: mit
- Created: 2017-08-15T04:28:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-15T06:24:23.000Z (almost 9 years ago)
- Last Synced: 2025-11-19T10:20:14.871Z (7 months ago)
- Topics: openlayers2, qgis, tilesets
- Language: HTML
- Size: 3.83 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ol2-offline
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](http://www.qgistutorials.com/en/docs/creating_basemaps_with_qtiles.html) plugin
for QGIS to easily build tiles sets from raster layers, aka GeoTiffs.
OpenLayers v2 [docs are here](http://dev.openlayers.org/apidocs/files/OpenLayers/Map-js.html), but it's essentially just:
```javascript
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);
```