Hello,

I'm having a WMTS server (geoserver) which seeds a layer trough EPSG:28992.
When I use that layer with OSM it is positioned way off. 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: 156543.0339,
        //maxResolution: "auto",
        units: "m",
        projection: new OpenLayers.Projection("EPSG:28992"),
        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:28992:" + i;
    }
    var osm = new OpenLayers.Layer.OSM();

    var wmts = new OpenLayers.Layer.WMTS({
        name: "Medford Buildings",
        url: "http://localhost/geoserver/gwc/service/wmts";,
        layer: "topp:O10004_gemeenten_xml",
        matrixSet: "EPSG:28992",
        matrixIds: matrixIds,
        format: "image/png",
        style: "",
        isBaseLayer: false
    });

    map.addLayers([osm, 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 here is my GeoWebCache.xml maybe i'm there is something wrong..

<?xml version="1.0" encoding="utf-8"?>
<gwcConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        
xsi:noNamespaceSchemaLocation="http://geowebcache.org/schema/1.2.2/geowebcache.xsd";
        xmlns="http://geowebcache.org/schema/1.2.2";>
<version>1.2.2</version>
<backendTimeout>120</backendTimeout>
<gridSets>
  <!-- Grid Set Example,
        by default EPSG:900913 and EPSG:4326 are defined -->
  <gridSet>
    <!-- This does not have to be an EPSG code, you can also
          have multiple gridSet elements per SRS -->
    <name>EPSG:28992</name>
    <srs><number>28992</number></srs>
    <extent>
       <coords>
        <double>-285401.920</double>
        <double>22598.080</double>
        <double>595401.920</double>
        <double>903401.920</double>
      </coords>
    </extent>
    <scaleDenominators>
       <double>12288000</double>
       <double>6144000</double>
       <double>3072000</double>
       <double>1536000</double>
       <double>768000</double>
       <double>384000</double>
       <double>192000</double>
       <double>96000</double>
       <double>48000</double>
       <double>24000</double>
       <double>12000</double>
       <double>6000</double>
       <double>3000</double>
       <double>1500</double>
     </scaleDenominators>
     <tileHeight>256</tileHeight>
    <tileWidth>256</tileWidth>
  </gridSet>
</gridSets>
<layers>
</layers>
</gwcConfiguration>

Met vriendelijke groet,
Lucas Heezen

[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]<mailto:[email protected]>



<<inline: image001.gif>>

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

Reply via email to