Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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);

Thanks

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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