Skip to main content
Small code change to reflect data in question.
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM32_EUREF89&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}';

var layer = new L.TileLayer(url, {
  subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  attribution: ''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
     origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( [-128543, 8015869], [1165657, 6381457]),
     resolutions: resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([59.877812, 8.590628], 05);

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM32_EUREF89&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}';

var layer = new L.TileLayer(url, {
  subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  attribution: ''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
     origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( [-128543, 8015869], [1165657, 6381457]),
     resolutions: resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([59.877812, 8.590628], 0);

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM32_EUREF89&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}';

var layer = new L.TileLayer(url, {
  subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  attribution: ''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
     origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( [-128543, 8015869], [1165657, 6381457]),
     resolutions: resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([59.877812, 8.590628], 5);
Adjusted code to reflect data in question.
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM32_EUREF89_v2&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1+'&layer=Nibcache_UTM32_EUREF89&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}';

var layer = new L.TileLayer(url, {
  subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  attribution: ''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
     origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( [-128543, 8015869], [1165657, 6381457]),
     resolutions: resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([65[59.877812, 13]8.590628], 0);

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM32_EUREF89_v2&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}';

var layer = new L.TileLayer(url, {
  subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  attribution: ''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
     origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( [-128543, 8015869], [1165657, 6381457]),
     resolutions: resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([65, 13], 0);

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM32_EUREF89&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}';

var layer = new L.TileLayer(url, {
  subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  attribution: ''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
     origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( [-128543, 8015869], [1165657, 6381457]),
     resolutions: resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([59.877812, 8.590628], 0);
Corrected errors and additional code.
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm33_wmts_v2nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM33_EUREF89&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1+'&layer=Nibcache_UTM32_EUREF89_v2&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}'; 

var maplayer = new L.TileLayer(url, {
      subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  maxZoomattribution: 16''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
 minZoom    origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( attribution[-128543, 8015869], [1165657, 6381457]),
     resolutions: ''resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([65, 13], 0);

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm33_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM33_EUREF89&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}';
var map = new L.TileLayer(url, {
      subdomains: ['1', '2', '3'],
        maxZoom: 16,
        minZoom: 0,
        attribution: ''    });

nmtoken is right, you need to request capabilities from the server. In your case you just need to add gkt (key) parameter with valid key value to the request:

https://gatekeeper1.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?REQUEST=GetCapabilities&service=WMTS&gkt=gkt_value

I sneaked gkt key from https://www.norgeskart.no/ site and got the following values (excerpt from GetCapabilities reply):

<ows:Identifier>Nibcache_UTM32_EUREF89_v2</ows:Identifier>
  <ows:BoundingBox crs="urn:ogc:def:crs:EPSG::25832">
  <ows:LowerCorner>-2000000.0 3500000.0</ows:LowerCorner>
  <ows:UpperCorner>3545984.0 9045984.0</ows:UpperCorner>
  </ows:BoundingBox>

In your case origin (upper left corner) would be:

origin: [-2500000.0, 9045984.0]

And by the way, I never was able to get WMTS plugin to work correctly togeteher with proj4leaflet. I constructed WMTS tile request myself. In your case it would be something like:

var gkt = 'gkt_value';
var url = 'http://gatekeeper{s}.geonorge.no/BaatGatekeeper/gk/gk.nib_utm32_wmts_v2?&gkt='
+ gkt +'&layer=Nibcache_UTM32_EUREF89_v2&style=default&tilematrixset=default028mm&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fpng&TileMatrix={z}&TileCol={x}&TileRow={y}'; 

var layer = new L.TileLayer(url, {
  subdomains: ['1', '2', '3'],
  maxZoom: 16,
  minZoom: 0,
  attribution: ''    });

var resol = [
  21664, 10832, 5416, 2708, 1354, 677, 338.5, 169.25, 84.625, 42.3125, 21.15625, 10.578125, 5.2890625, 2.64453125, 1.322265625, 0.661132813, 0.330566406
];

var crs = new L.Proj.CRS('EPSG:25832','+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs',
   {
     origin: [-2000000.0, 9045984.0],
     bounds:  L.bounds( [-128543, 8015869], [1165657, 6381457]),
     resolutions: resol
   });

map = new L.Map('map', {
  crs: crs
});

map.addLayer(layer);
map.setView([65, 13], 0);
Typo.
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42
Loading
added 746 characters in body
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42
Loading
Source Link
TomazicM
  • 27k
  • 24
  • 31
  • 42
Loading