Openlayers v6 test

by Vladimir Vershinin

HTML

<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/build/ol.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.3.1/css/ol.css">
<script src="https://unpkg.com/[email protected]/dist/proj4-src.js"></script>
<div style="display: flex; width: 100%; height: 100%">
<div id="map" class="map"></div>
<div id="map2" class="map"></div>
</div>

CSS

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

#map, #map2 {
  height: 100%;
  width: 50%;
}

JavaScript

console.log(ol)

proj4.defs(
  "EPSG:5514,EPSG:1623",
  "+proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 " +
  "+alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel " +
  "+towgs84=570.8,85.7,462.8,4.998,1.587,5.261,3.56 " +
  "+pm=greenwich +units=m +no_defs"
);
ol.proj.proj4.register(proj4);

var map = new ol.Map({
  layers: [
    new ol.layer.Tile({
      source: new ol.source.WMTS({
        url: 'https://train.tere-za.eu/mapproxy/wmts/hasici_prod/krovak_2_grid/{TileMatrix}/{TileCol}/{TileRow}.jpeg',
        crossOrigin: "Anonymous",
        tileGrid: new ol.tilegrid.WMTS({
          extent: [
            -961337.79165191948,
            -1272298.7703143731,
            -392338.62928383797,
            -894487.03136110306,
          ],
          origin: [-37069593.709789924, 37072896.023036771],
          resolutions: [
            529.16772500211675,
            264.58386250105838,
            132.29193125052919,
            52.916772500211671,
            26.458386250105836,
            13.229193125052918,
            5.2916772500211673,
            2.6458386250105836,
            1.3229193125052918,
            0.52916772500211673,
            0.26458386250105836,
          ],
          matrixIds: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
          tileSize: [256, 256],
        }),
        projection: 'EPSG:5514,EPSG:1623',
        layer: "hasici_prod",
        style: 'default',
        matrixSet: 'krovak_2_grid',
        format: "image/jpeg",
        requestEncoding: "REST",
      }),
    }),
  ],
  target: 'map',
  view: new ol.View({
    projection: 'EPSG:5514,EPSG:1623',
    center: ol.proj.transform([15.43, 50], 'EPSG:4326', 'EPSG:5514,EPSG:1623'),
    zoom: 0,
    resolutions: [
      529.16772500211675,
      264.58386250105838,
      132.29193125052919,
      52.916772500211671,
      26.458386250105836,
      13.229193125052918,
      5.2916772500211673,
      2.6458386250105836,
      1.3229193125052918,
      0.52916772500211673,
     ...