<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-AU link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>I have a layer based on a 3rd-party map provider that uses an XYZ layer type that is optimised to show Australia and New Zealand. If I just let the layer run with sphericalMercator set to true, and don&#8217;t set anything else, everything's fine. However, I want to be able to limit the number of layers available based on criteria like zoom level (e.g. the map should have zoom levels between 20km and 1 km). I have been able to do this with other layer types like ArcGIS93Rest by having a resolutions array in advance, and truncating it according to the calculated zoom level and then passing it to the map object.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I can't get the same idea to work if I use an XYZ layer. It won't work properly if I pass in any array of resolutions, even if it's the same array of Spherical Mercator resolutions that it generates itself. <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Based on the information in <a href="http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels">http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels</a> I've tried setting the minZoomLevel/maxZoomLevel, minResolution/maxResolution. These seem to have no effect, or they create bizarre results. The only setting that seems to constrain the levels is numZoomLevels, but this doesn't give me any control over which range of levels it selects - if I set it to 10, it defaults to the outermost 10.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>(I have the same issue with the OSM layer type, which I would like to have as a fallback if the main map provider fails - again I can't seem to specify the exact zoom levels I want.)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>One issue - I'm not passing the array into the map constructor via the options parameter during initialisation. Due to the way the code has been written, it creates an empty map object, then sets various parameters. I don&#8217;t know it that's a factor.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>One other thing that seems a bit odd - even if I can successfully set the levels with a resolutions array, I still have to specify the number of zoom levels in the map object. I thought it would figure this out itself from the size of the array.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Rohan Parkes<o:p></o:p></p><p class=MsoNormal>Melbourne<o:p></o:p></p></div></body></html>