[OpenLayers-Users] Trouble with Google and WMTS

Heiner Lamprecht heiner at heiner-lamprecht.net
Wed Aug 31 11:24:07 EDT 2011


Hi,

I'm currently developing an application, which uses as WMTS Layer.  But I get some
problems, if I want to combine it with Google layer.  As soon as the Google layer is
added as new base layer, the tile IDs requested by the WMTS change.

Without Google layer, the WMTS layer starts counting at -180 / 90.  With Google layer,
it seems to start counting at 0, 0.  Next to this, the WMTS layer only requests two
tile.  The one with (0, 0) as top left corner, and the one with (0, 0) as top right
corner.
The map uses EPSG:4326 as projection.  The two layers are added as follows:

---------------------------------------------------------------------------------------
    var gphy = new OpenLayers.Layer.Google(
        "Google Physical",
        {
            type: google.maps.MapTypeId.TERRAIN,
            transitionEffect: 'resize',
            opacity: 0.6
        });

    this._olMap.addLayer(gphy);

    var miscLayer = new OpenLayers.Layer.WMTS({
        name: "Misc Layer",
        url: this._miscChartService,
        layer: "default",
        matrixSet: this._miscMatrixSet,
        format: "image/png",
        style: "basic",
        opacity: 0.6,
        tileOrigin: new OpenLayers.LonLat(-180, 90),
        isBaseLayer: false,
        transitionEffect: 'resize'
    });
    this._olMap.addLayer(miscLayer);
---------------------------------------------------------------------------------------

I played a bit with "tileOrigin", but the did not change the fact, that only two tiles
were requested.  Only the tile IDs had changed.

This all looks quite strange to me, and I didn't find anything about how adding a
Google layer changes the behavior of OpenLayers.

Any hints?


Thanks in advance,


    Heiner



More information about the Users mailing list