1

I want to achieve the following:

  • Create an OpenLayers map, that runs totally in a local CRS.
  • The basic layer would be a raster tile layer.
  • The tiles will be generated by us once for each project (based on TIFFs or other images, provided by our customers) and stored in the file system (the area is very small (~ 10x10 km) and there will be none or not many redundant tiles).
  • Make the tile generation process as easy, as possible.

We can assume, that the images, provided by our customers have the right orientation and it should be okay, just to say: The upper left pixel of the map is x1/y1 and the lower right pixel is x2/y2 to have our local CRS. Projections are irrelevant for us here.

My question is: Is it possible in OpenLayers, to create a base layer, define the URL of the tiles and say: "the upper left corner of the first tile (0/0) is at x: 5271 and y: 12 in my local coordinate system and another point at tile XYZ is at x: 5427 and y: 634".

Or do I have to bring the tiles in a predefined format? Or do I have to create a custom projection definition or something like that?

0

Setting a tile layer into my local CRS works:

var tiles = new OpenLayers.Layer.XYZ("Local tiles", "tiles/${z}/${x}/${y}.png", {
    isBaseLayer: true,
    maxExtent: [
        x1,
        y2,
        x2,
        y1
    ]
});
map.addLayer(tiles);

x1/y1 are the coordinates of the upper left corner of the tile at zoom level 0 and x2/y2 the coordinates of the lower right corner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.