hi,
I'm trying to get wmts in lv95 working in OL3.11.2.
I found two type of codes and both do not work.
first way is form the api site:
https://api3.geo.admin.ch/examples/ol3_lv95.jsvar RESOLUTIONS = [
4000, 3750, 3500, 3250, 3000, 2750, 2500, 2250, 2000, 1750, 1500, 1250,
1000, 750, 650, 500, 250, 100, 50, 20, 10, 5, 2.5, 2, 1.5, 1, 0.5
];
var extent = [2420000, 130000, 2900000, 1350000];
var projection = ol.proj.get("EPSG:2056");
projection.setExtent(extent);
var matrixIds = [];
for (var i = 0; i < RESOLUTIONS.length; i++) {
matrixIds.push(i);
}
var tileGrid = new ol.tilegrid.WMTS({
origin: [extent[0], extent[3]],
resolutions: RESOLUTIONS,
matrixIds: matrixIds
});
var swisstopo = new ol.layer.Tile({
source: ol.source.WMTS({
attributions: [new ol.Attribution({
html: "swisstopo"
})
],
url: "http://wmts10.geo.admin.ch/1.0.0/{Layer}/default/20140620/2056/{TileMatrix}/{TileCol}/{TileRow}.jpeg",
tileGrid: tileGrid,
projection: projection,
layer: "ch.swisstopo.swissimage",
requestEncoding: "REST"
})
});
this throws an OL Error:
Uncaught TypeError: this.resetCoordKeyPrefix_ is not a function
secod way is from this group:
https://groups.google.com/forum/#!searchin/geoadmin-api/wmts/geoadmin-api/0qOo0gV7f_w/86YlgpriXj8Jvar swisstopo = new ol.layer.Tile({
source: new ol.source.WMTS({
attributions: [new ol.Attribution({
html: 'Pixelmap / geo.admin.ch</a>'
})],
urls: ['http://wmts10.geo.admin.ch/'],
layer: 'ch.swisstopo.swissimage',
matrixSet: 'EPSG:2056',
format: 'image/jpeg',
opacity: 1.0,
crossOrigin: 'anonymous',
requestEncoding: "REST",
version: '1.0.0',
dimensions: ['TIME'],
params: {'time': '20140620'},
projection: projection,
tileGrid: tileGrid,
style: 'default'
})
});this way OL doesn't complain, but the requests don't have query-params:

Anyone can help me get this working? or any hints?