im trying to make a fictional world map for a game in openlayers 3.
I have my high res img (4096x4096 pixels) tiled up for 4 zoom lvls (with 0 zoom lvl being 4 tiles).
I fought my way through projection problems (ofc there is no gis system for such map) and i got this as a result:
var pixelProj = new ol.proj.Projection({ code: "CTW", units: 'pixels', extent: [0,0,4096 ,4096] })var map = new ol.Map({ // here i tried do something about loading to no avail loadTilesWhileAnimating: true, loadTilesWhileInteracting: true, target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.XYZ({ url: '/path/to/map/map_tiles/{z}/map_tile_{x}_{y}.png', wrapX: false, projection: pixelProj }), tileSize: 256 }) ], view: new ol.View({ projection: pixelProj, extent: pixelProj.getExtent(), center: [2048,2048], zoom:1, minZoom:1, maxZoom:3 }) });And here is the problem, i got working map, tiles are being downloaded (according to network tab in chrome dev-tools) but i only ever seen one tile, namely the top left one for zoom lvl 0.
All tiles are 256x256px in size.
If anyone knows what i did wrong or what im missing, any advice or pointer will be greatly appreciated.
أكثر...
I have my high res img (4096x4096 pixels) tiled up for 4 zoom lvls (with 0 zoom lvl being 4 tiles).
I fought my way through projection problems (ofc there is no gis system for such map) and i got this as a result:
var pixelProj = new ol.proj.Projection({ code: "CTW", units: 'pixels', extent: [0,0,4096 ,4096] })var map = new ol.Map({ // here i tried do something about loading to no avail loadTilesWhileAnimating: true, loadTilesWhileInteracting: true, target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.XYZ({ url: '/path/to/map/map_tiles/{z}/map_tile_{x}_{y}.png', wrapX: false, projection: pixelProj }), tileSize: 256 }) ], view: new ol.View({ projection: pixelProj, extent: pixelProj.getExtent(), center: [2048,2048], zoom:1, minZoom:1, maxZoom:3 }) });And here is the problem, i got working map, tiles are being downloaded (according to network tab in chrome dev-tools) but i only ever seen one tile, namely the top left one for zoom lvl 0.
All tiles are 256x256px in size.
If anyone knows what i did wrong or what im missing, any advice or pointer will be greatly appreciated.
أكثر...