On Fri, Nov 25, 2011 at 3:59 PM, Tobias Reinicke <[email protected]> wrote:

> Hi,
>
> What size are the tiles you are bringing back via WMTS? If they are bigger
> than the map window (i.e. 512 x  512) that might be the prob.
>

No. OpenLayers can handle that fine. Lucas, the problem is that you have
set maxResolution to "auto", so it will be calculated from the map viewport
size. You will want to use a maxResolution of 156543.0339 instead.

Andreas.


>
> Toby
>
> On 25 November 2011 14:54, Lucas Heezen - Covadis <[email protected]>wrote:
>
>>  Hello, ****
>>
>> ** **
>>
>> I have downloaded the WMTS example from OpenLayers. I have modified it so
>> it can be used as baseLayer.****
>>
>> But when I change the map size (css) the WMTS doesn’t show up.****
>>
>> ** **
>>
>> Here is my code:****
>>
>> ** **
>>
>> *var* map;****
>>
>> ** **
>>
>> *function* init() {****
>>
>>        ****
>>
>>     // Alle map opties gaan meegeven aan de map,****
>>
>>     *var* mapOptions = {****
>>
>>         theme: *null*,****
>>
>>         numZoomLevels: 27,****
>>
>>         //controls: [ ],****
>>
>>         //maxExtent: bounds,****
>>
>>         maxExtent: *new* OpenLayers.Bounds(-20037508,
>> -20037508,20037508, 20037508.34),****
>>
>>         maxResolution: "auto",****
>>
>>         units: "m",****
>>
>>         projection: *new* OpenLayers.Projection("EPSG:900913"),****
>>
>>         displayProjection: *new* OpenLayers.Projection("EPSG:28992")****
>>
>>     };****
>>
>>     map = *new* OpenLayers.Map( "map", mapOptions );****
>>
>>     ****
>>
>>     *var* *osm* = *new* OpenLayers.Layer.OSM();****
>>
>>     ****
>>
>>     // If tile matrix identifiers differ from zoom levels (0, 1, 2, ...)*
>> ***
>>
>>     // then they must be explicitly provided.****
>>
>>     *var* matrixIds = *new* Array(26);****
>>
>>     *for* (*var* i=0; i<26; ++i) {****
>>
>>         matrixIds[i] = "EPSG:900913:" + i;****
>>
>>     }****
>>
>> ** **
>>
>>     *var* wmts = *new* OpenLayers.Layer.WMTS({****
>>
>>         name: "Medford Buildings",****
>>
>>         url: "http://localhost/geoserver/gwc/service/wmts",****
>>
>>         layer: "topp:O10004_gemeenten_xml",****
>>
>>         matrixSet: "EPSG:900913",****
>>
>>         matrixIds: matrixIds,****
>>
>>         format: "image/png",****
>>
>>         style: "",****
>>
>>         isBaseLayer: *true*****
>>
>>     });                        ****
>>
>>     ****
>>
>>     map.addLayers([wmts]);****
>>
>>     map.addControl(*new* OpenLayers.Control.LayerSwitcher());****
>>
>>     *var* lon = 663907.86312027;****
>>
>>     *var* lat = 6999450.3161499;****
>>
>>     *var* zoom = 8;****
>>
>>     map.setCenter(*new* OpenLayers.LonLat(lon, lat), zoom);****
>>
>>     ****
>>
>> }****
>>
>> ** **
>>
>> And the css****
>>
>> ** **
>>
>> *.smallmap* {****
>>
>>     width: *512px*;****
>>
>>     height: *256px*;****
>>
>>     border: *1px* *solid* *#ccc*;****
>>
>> }****
>>
>> ** **
>>
>> ** **
>>
>> Met vriendelijke groet,
>> Lucas Heezen****
>>
>> [image: Beschrijving: http://www.covadis.nl/emailkop/logo.gif]****
>>
>> Covadis b.v. ****
>>
>> t: 026 3616600 ****
>>
>> Geograaf 12 ****
>>
>> f: 026 3612317 ****
>>
>> 6921 EW Duiven ****
>>
>> e: [email protected]****
>>
>> ** **
>>
>> _______________________________________________
>> Users mailing list
>> [email protected]
>> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>>
>>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>


-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.

<<image001.gif>>

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to