[GIS] OpenLayers 3 ol.source.xyz set custom origin

openlayerstile-map-servicetile-server

I am using local tiles from my file system in OpenLayers 3 (ol.source.xyz), and my local tiles are stored as 0/0/0.png and so on. Now the thing is that when I use these tiles on my map it starts from the top left corner (0,0), instead of I want to set custom origin of my tiles, is there any way to change the origin (instead of 0,0, I want to use my own custom coordinates).

Here is my code:

enter image description here

Best Answer

you can use a custom tilegrid within your tile source configuration , and set the origin

api doc here

and example here

Related Question