0

Hopefully someone can help.

I've created a TMS Layer in OpenLayers which has some local tiles these tiles are OSGB OpenData. I'm trying to get the initial zoom to be level 4 instead of 0. However OpenLayers seems to be ignoring the zoomOffset option.

Here is an example of my layer:

 var newLayer = new OpenLayers.Layer.TMS("Test Layer", "", {
        type:"png",
        getURL:overlay_getTileURL,
        alpha:true,
        setIsBaseLayer:true,
        'buffer':0,
        transitionEffect: 'resize',
        projection:new OpenLayers.Projection(projection),
        displayProjection:new OpenLayers.Projection(displayProjection),
        units:"m",
        resolutions:[400.0, 200.0, 100.0, 50.0],
        maxResolution:"auto",
        maxExtent:new OpenLayers.Bounds(0.0, 0.0, 700000.0, 1300000.0),
        zoomOffset:4
    });

  map.addLayer(newLayer);

1 Answer 1

0

I managed to fix this issue by using the Resolution Array and passing the tile offset to the getURL function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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