<div dir="ltr"><div><div>Hello OpenLayers List!<br><br>My first time working with OL and I've been trying to get a WMTS[1] to load in version 2.11 and feel like I'm getting close because it is grabbing tiles, sort of...<br>
<br>This is so that I can modify a plugin[2] for QGIS to let me load this WMTS as a basemap.<br><br></div><div>But I can't figure out what some of the needed parameters are - been trying to interpret the GetCapabilities[1] xml and have figured some stuff out I think.<br>
</div><div><br></div><div>I'm using the OpenLayers.Layer.XYZ method because this WMTS use that form of URL for requests:<br><a href="http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg">http://maps.wien.gv.at/wmts/lb/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.jpeg</a><br>
</div><div><br></div><div>So under the OpenLayers.map part, I have...<br>maxExtent: new OpenLayers.Bounds(1799448.39, 6124949.74, 1848250.44, 6162571.82)<br><br></div><div>...which I got from generating an extent polygon from the two x,y points given by the Lower/UpperCorner in the TileMatrixSet.<br>
<br></div><div>I don't know if that was the right way to get the bounds... but in QGIS[3] it looks OK with overtop Google basemaps..<br><br></div><div>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></div><div>I don't know what to enter for the maxResolution or if I've set the two options correctly:<br>sphericalMercator: false,<br>wrapDateLine: false,<br>
</div><div><br></div></div>The file I'm trying to get working is openlayers/html/schnittstellen.html and that is found in the zipfile[4] I uploaded to my dropbox.<br><div>All the other HTML files in that folder work as expected. When I open that file, it grabs an empty white tile and this is the example URL: <a href="http://maps1.wien.gv.at/wmts/lb/farbe/google3857/0/67/52.jpg">http://maps1.wien.gv.at/wmts/lb/farbe/google3857/0/67/52.jpg</a><br>
</div><div><br><div>But I don't know why it's not working - can someone help me figure this out please? Thanks in advance.<br></div><br>[1] <a href="http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml">http://maps.wien.gv.at/wmts/1.0.0/WMTSCapabilities.xml</a><br>
[2] <a href="http://plugins.qgis.org/plugins/openlayers_plugin/">http://plugins.qgis.org/plugins/openlayers_plugin/</a><br>[3] <a href="http://susepaste.org/images/7ea74f53.jpeg">http://susepaste.org/images/7ea74f53.jpeg</a><br>
[4] <a href="https://dl.dropbox.com/u/33592962/outgoing/openlayers.zip">https://dl.dropbox.com/u/33592962/outgoing/openlayers.zip</a><br></div></div>