<div dir="ltr">Hi,<div><br></div><div>   I recently faced this problem. I solved it by setting a tileOrigin:</div><div>{..., tileOrigin: new OpenLayers.LonLat(-20037508.34, -20037508.34), ...}</div><div>in the layer options, and patching the OpenLayers.Layers.XYZ.getXYZ function to use "this.tileOrigin.lon" instead of "this.maxExtent.left" and "-this.tileOrigin.lat" instead of "this.maxExtent.lon".</div>
<div><br></div><div>   I am using OpenLayers 2.12 and after making that change my tiles were requested properly.</div><div><br></div><div>-Dave</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Apr 29, 2013 at 9:49 AM, semiaddict <span dir="ltr"><<a href="mailto:news@semiaddict.com" target="_blank">news@semiaddict.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I am trying to setup an OL map that uses an XYZ layer as its base layer,<br>
with the tiles served from an mbtiles file using mbtiles-php<br>
(<a href="https://github.com/infostreams/mbtiles-php/" target="_blank">https://github.com/infostreams/mbtiles-php/</a>). The mbtiles file only<br>
contains tiles for the Paris, France region with zoom levels between 11 and<br>
19.<br>
<br>
I managed to get this working fine with the basic settings<br>
(<a href="http://orbes.mobi/cinemacity/tests/test2.html" target="_blank">http://orbes.mobi/cinemacity/tests/test2.html</a> - source:<br>
<a href="http://orbes.mobi/cinemacity/tests/test2.js" target="_blank">http://orbes.mobi/cinemacity/tests/test2.js</a>), but I would like to add zoom<br>
and extent restrictions. As soon as I do so by adding the layer options<br>
maxExtent, zoomOffset, or numZoomLevels, the XYZ parameters used in the tile<br>
URLs become relative instead of absolute<br>
(<a href="http://orbes.mobi/cinemacity/tests/test1.html" target="_blank">http://orbes.mobi/cinemacity/tests/test1.html</a> - source:<br>
<a href="http://orbes.mobi/cinemacity/tests/test1.js" target="_blank">http://orbes.mobi/cinemacity/tests/test1.js</a>).<br>
<br>
Am I using the wrong options, or do I need to override the getXYZ function,<br>
and with what ?<br>
<br>
Thank you in advance for any help.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/XYZ-Layer-with-zoom-and-extent-restrictions-tp5050252.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/XYZ-Layer-with-zoom-and-extent-restrictions-tp5050252.html</a><br>

Sent from the OpenLayers Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</blockquote></div><br></div>