How to offset XYZ tile layer in OpenLayers 3

المشرف العام

Administrator
طاقم الإدارة
I have an OSM layer and a layer with own tiles of the type ol.layer.Tile with ol.source.XYZ source. Both using 256x256 px tiles.

Unfortunately, the areas in both layers are not congruent (i.e. they are shifted). To fix that I am looking for a method to change the origin of the XYZ layer.

I can get the origin through:

tileLayer.getProperties().source.getTileGrid().getOrigin() however, I don't find a way to change it.

I know that tile layers with an "ol.source.TileImage"-source can take an "origin"-parameter within the tileGrid option (http://openlayers.org/en/v3.8.2/apidoc/ol.source.TileImage.html). But in the "ol.source.XYZ" layers, this does not work for me.

Any ideas? Thanks



أكثر...
 
أعلى