<div dir="ltr"><div>That example wasn't in the 2.11 exampels - having a look now.<br><br></div>I'm still curious though, how you go about finding the maxResolution though....<br></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, Feb 21, 2013 at 8:00 AM, Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You may want to have a look at<br>
<a href="http://openlayers.org/dev/examples/mobile-wmts-vienna.js" target="_blank">http://openlayers.org/dev/examples/mobile-wmts-vienna.js</a>, which shows<br>
both how to configure WMTS layers manually and how to create them from<br>
a GetCapabilities response.<br>
<br>
OpenLayers.Layer.XYZ won't help you in most cases, because WMTS layers<br>
can have a different grid layout for each resolution.<br>
<br>
Andreas.<br>
<div><div class="h5"><br>
On Thu, Feb 21, 2013 at 5:29 AM, Donovan Cameron <<a href="mailto:sault.don@gmail.com">sault.don@gmail.com</a>> wrote:<br>
> Hello OpenLayers List!<br>
><br>
> My first time working with OL and I've been trying to get a WMTS[1] to load<br>
> in version 2.11 and feel like I'm getting close because it is grabbing<br>
> tiles, sort of...<br>
><br>
> This is so that I can modify a plugin[2] for QGIS to let me load this WMTS<br>
> as a basemap.<br>
><br>
> But I can't figure out what some of the needed parameters are - been trying<br>
> to interpret the GetCapabilities[1] xml and have figured some stuff out I<br>
> think.<br>
><br>
> I'm using the OpenLayers.Layer.XYZ method because this WMTS use that form of<br>
> URL for requests:<br>
> <a href="http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg" target="_blank">http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg</a><br>

><br>
> So under the OpenLayers.map part, I have...<br>
> maxExtent: new OpenLayers.Bounds(1799448.39, 6124949.74, 1848250.44,<br>
> 6162571.82)<br>
><br>
> ...which I got from generating an extent polygon from the two x,y points<br>
> given by the Lower/UpperCorner in the TileMatrixSet.<br>
><br>
> I don't know if that was the right way to get the bounds... but in QGIS[3]<br>
> it looks OK with overtop Google basemaps..<br>
><br>
> So then I used that polygons centre x,y to fill out the setCenter option:<br>
> map.setCenter(new OpenLayers.LonLat(1823849.41, 6143760.78), 0);<br>
><br>
> I don't know what to enter for the maxResolution or if I've set the two<br>
> options correctly:<br>
> sphericalMercator: false,<br>
> wrapDateLine: false,<br>
><br>
> The file I'm trying to get working is openlayers/html/schnittstellen.html<br>
> and that is found in the zipfile[4] I uploaded to my dropbox.<br>
> All the other HTML files in that folder work as expected. When I open that<br>
> file, it grabs an empty white tile and this is the example URL:<br>
> <a href="http://maps1.wien.gv.at/wmts/lb/farbe/google3857/0/67/52.jpg" target="_blank">http://maps1.wien.gv.at/wmts/lb/farbe/google3857/0/67/52.jpg</a><br>
><br>
> But I don't know why it's not working - can someone help me figure this out<br>
> please? Thanks in advance.<br>
><br>
> [1] <a href="http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml" target="_blank">http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml</a><br>
> [2] <a href="http://plugins.qgis.org/plugins/openlayers_plugin/" target="_blank">http://plugins.qgis.org/plugins/openlayers_plugin/</a><br>
> [3] <a href="http://susepaste.org/images/7ea74f53.jpeg" target="_blank">http://susepaste.org/images/7ea74f53.jpeg</a><br>
> [4] <a href="https://dl.dropbox.com/u/33592962/outgoing/openlayers.zip" target="_blank">https://dl.dropbox.com/u/33592962/outgoing/openlayers.zip</a><br>
><br>
</div></div>> _______________________________________________<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>
><br>
<br>
<br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
</blockquote></div><br></div>