Skip to content

Commit

Permalink
Merge pull request #17 from SDFIdk/update_daf_services
Browse files Browse the repository at this point in the history
Update DAF services
  • Loading branch information
iamfrank authored Nov 25, 2024
2 parents 51f5c82 + dacd5b0 commit a3eb660
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 87 deletions.
29 changes: 14 additions & 15 deletions examples/leaflet/example1.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ <h1>WMTS med <a href="https://leafletjs.com">LeafletJS</a></h1>

<script>

// Set Kortforsyningen token, replace with your own token
const dftoken = '9ca510be3c4eca89b1333cadbaa60c36';
// Set Datafordeler username/password. Replace with your own
const dfUser = 'QKJBQATHVS'
const dfPass = 'ytxCA8UGM5n0Z*zi'

// Set the attribution (the copyright statement shown in the lower right corner)
// We do this as we want the same attributions for all layers
Expand All @@ -58,7 +59,7 @@ <h1>WMTS med <a href="https://leafletjs.com">LeafletJS</a></h1>

// Define layers
// Ortofoto [WMTS:orto_foraar]
const ortofotowmts = L.tileLayer('https://api.dataforsyningen.dk/orto_foraar_wmts_DAF?service=WMTS&request=GetTile&version=1.3.0&Layer=orto_foraar_wmts&style=default&format=image/jpg&TileMatrixSet=KortforsyningTilingDK&TileMatrix={zoom}&TileRow={y}&TileCol={x}&token=' + dftoken, {
const ortofotowmts = L.tileLayer(`https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar_wmts/1.0.0/WMTS?username=${ dfUser }&password=${ dfPass }&service=WMTS&request=GetTile&version=1.0.0&Layer=orto_foraar_wmts&style=default&format=image/jpg&TileMatrixSet=KortforsyningTilingDK&TileMatrix={zoom}&TileRow={y}&TileCol={x}`, {
minZoom: 0,
maxZoom: 13,
attribution: myAttributionText,
Expand All @@ -69,7 +70,7 @@ <h1>WMTS med <a href="https://leafletjs.com">LeafletJS</a></h1>
}).addTo(map);

// Skærmkort [WMTS:topo_skaermkort]
const toposkaermkortwmts = L.tileLayer('https://api.dataforsyningen.dk/topo_skaermkort_wmts_DAF?service=WMTS&request=GetTile&version=1.3.0&Layer=topo_skaermkort&style=default&format=image/png&TileMatrixSet=View1&TileMatrix={zoom}&TileRow={y}&TileCol={x}&token=' + dftoken, {
const toposkaermkortwmts = L.tileLayer(`https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort_wmts/1.0.0/wmts?username=${ dfUser }&password=${ dfPass }&service=WMTS&request=GetTile&version=1.0.0&Layer=topo_skaermkort&style=default&format=image/png&TileMatrixSet=View1&TileMatrix={zoom}&TileRow={y}&TileCol={x}`, {
minZoom: 0,
maxZoom: 13,
attribution: myAttributionText,
Expand All @@ -80,24 +81,22 @@ <h1>WMTS med <a href="https://leafletjs.com">LeafletJS</a></h1>
}).addTo(map);

// Matrikelskel overlay [WMS:mat]
const matrikel = L.tileLayer.wms('https://api.dataforsyningen.dk/MatrikelGaeldendeOgForeloebigWMS_DAF?ignoreillegallayers=TRUE', {
transparent: true,
layers: 'MatrikelSkel_Gaeldende,Centroide_Gaeldende',
token: dftoken,
const matrikelServiceWmsUrl = `https://services.datafordeler.dk/MATRIKLEN2/MatGaeldendeOgForeloebigWMS/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const matrikel = L.tileLayer.wms(matrikelServiceWmsUrl, {
transparent: 'TRUE',
layers: 'MatrikelSkel_Gaeldende',
format: 'image/png',
attribution: myAttributionText,
continuousWorld: true,
minZoom: 9
}).addTo(map); // addTo means that the layer is visible by default

// Hillshade overlay [WMS:dhm]
const hillshade = L.tileLayer.wms('https://api.dataforsyningen.dk/dhm?ignoreillegallayers=TRUE', {
transparent: true,
layers: 'dhm_terraen_skyggekort_transparent_overdrevet',
token: dftoken,
const hillshadeServiceWmsUrl = `https://services.datafordeler.dk/DHMNedboer/dhm/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const hillshade = L.tileLayer.wms(hillshadeServiceWmsUrl, {
transparent: 'TRUE',
layers: 'dhm_terraen_skyggekort',
format: 'image/png',
attribution: myAttributionText,
continuousWorld: true
attribution: myAttributionText
});

// Define layer groups for layer control
Expand Down
37 changes: 19 additions & 18 deletions examples/leaflet/example2.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ <h1>WMS med <a href="https://leafletjs.com">LeafletJS</a></h1>

<script>

// Set Kortforsyningen token, replace with your own token
const dftoken = '9ca510be3c4eca89b1333cadbaa60c36';
// Set Datafordeler username/password. Replace with your own
const dfUser = 'QKJBQATHVS'
const dfPass = 'ytxCA8UGM5n0Z*zi'

// Set the attribution (the copyright statement shown in the lower right corner)
// We do this as we want the same attributions for all layers
Expand Down Expand Up @@ -59,40 +60,40 @@ <h1>WMS med <a href="https://leafletjs.com">LeafletJS</a></h1>
// Define layers

// Ortofoto [WMS:orto_foraar]
const ortofotowms = L.tileLayer.wms('https://api.dataforsyningen.dk/orto_foraar_DAF?ignoreillegallayers=TRUE', {
const ortofotoServiceWmsUrl = `https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const ortofotowms = L.tileLayer.wms(ortofotoServiceWmsUrl, {
transparent: 'TRUE',
layers: 'orto_foraar',
token: dftoken,
format: 'image/png',
attribution: myAttributionText
}).addTo(map);
});

// Skærmkort [WMS:topo_skaermkort]
const toposkaermkortwms = L.tileLayer.wms('https://api.dataforsyningen.dk/topo_skaermkort_DAF?ignoreillegallayers=TRUE', {
const skaermkortServiceWmsUrl = `https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort/1.0.0/wms?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const toposkaermkortwms = L.tileLayer.wms(skaermkortServiceWmsUrl, {
transparent: 'FALSE',
layers: 'dtk_skaermkort',
token: dftoken,
format: 'image/png',
attribution: myAttributionText
}).addTo(map);

// Matrikelskel overlay [WMS:mat]
const matrikel = L.tileLayer.wms('https://api.dataforsyningen.dk/MatrikelGaeldendeOgForeloebigWMS_DAF?ignoreillegallayers=TRUE', {
transparent: true,
layers: 'MatrikelSkel_Gaeldende,Centroide_Gaeldende',
token: dftoken,
const matrikelServiceWmsUrl = `https://services.datafordeler.dk/MATRIKLEN2/MatGaeldendeOgForeloebigWMS/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const matrikel = L.tileLayer.wms(matrikelServiceWmsUrl, {
transparent: 'TRUE',
layers: 'MatrikelSkel_Gaeldende',
format: 'image/png',
attribution: myAttributionText,
continuousWorld: true,
minZoom: 9
}).addTo(map); // addTo means that the layer is visible by default

// Hillshade overlay [WMS:dhm]
const hillshade = L.tileLayer.wms('https://api.dataforsyningen.dk/dhm?ignoreillegallayers=TRUE', {
transparent: true,
layers: 'dhm_terraen_skyggekort_transparent_overdrevet',
token: dftoken,
const hillshadeServiceWmsUrl = `https://services.datafordeler.dk/DHMNedboer/dhm/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const hillshade = L.tileLayer.wms(hillshadeServiceWmsUrl, {
transparent: 'TRUE',
layers: 'dhm_terraen_skyggekort',
format: 'image/png',
attribution: myAttributionText,
continuousWorld: true
attribution: myAttributionText
});

// Define layer groups for layer control
Expand Down
23 changes: 12 additions & 11 deletions examples/leaflet/example3.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ <h1>GSearch type-ahead eksempel</a></h1>

import { GSearchUI, translator } from '../lib/leaflet.js'

// Set Kortforsyningen token, replace with your own token
const dftoken = '9ca510be3c4eca89b1333cadbaa60c36';
// Set Datafordeler username/password. Replace with your own
const dfUser = 'QKJBQATHVS'
const dfPass = 'ytxCA8UGM5n0Z*zi'

// Set the attribution (the copyright statement shown in the lower right corner)
// We do this as we want the same attributions for all layers
Expand All @@ -75,21 +76,21 @@ <h1>GSearch type-ahead eksempel</a></h1>
// Define layers

// Ortofoto [WMS:orto_foraar]
const ortofotowms = L.tileLayer.wms('https://api.dataforsyningen.dk/orto_foraar_DAF?ignoreillegallayers=TRUE', {
const ortofotoServiceWmsUrl = `https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const ortofotowms = L.tileLayer.wms(ortofotoServiceWmsUrl, {
transparent: 'TRUE',
layers: 'orto_foraar',
token: dftoken,
format: 'image/png',
attribution: myAttributionText,
maxNativeZoom: 14
attribution: myAttributionText
});

// Skærmkort [WMTS:topo_skaermkort]
const toposkaermkortwms = L.tileLayer.wms('https://api.dataforsyningen.dk/topo_skaermkort_DAF?ignoreillegallayers=TRUE', {
// Skærmkort [WMS:topo_skaermkort]
const skaermkortServiceWmsUrl = `https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort/1.0.0/wms?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const toposkaermkortwms = L.tileLayer.wms(skaermkortServiceWmsUrl, {
transparent: 'FALSE',
layers: 'dtk_skaermkort',
token: dftoken,
format: 'image/png',
attribution: myAttributionText,
maxNativeZoom: 14
attribution: myAttributionText
}).addTo(map);

// Define layer groups for layer control
Expand Down
16 changes: 10 additions & 6 deletions examples/leaflet/example4.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ <h1>Skift fra WMTS til WMS i det inderste zoom-niveau</h1>

<script>

// Set Kortforsyningen token, replace with your own token
const dftoken = '9ca510be3c4eca89b1333cadbaa60c36';
// Set Datafordeler username/password. Replace with your own
const dfUser = 'QKJBQATHVS'
const dfPass = 'ytxCA8UGM5n0Z*zi'

// Set the attribution (the copyright statement shown in the lower right corner)
// We do this as we want the same attributions for all layers
Expand Down Expand Up @@ -59,21 +60,24 @@ <h1>Skift fra WMTS til WMS i det inderste zoom-niveau</h1>
// Define layers

// Skærmkort [WMTS:topo_skaermkort]
const wmts = L.tileLayer('https://api.dataforsyningen.dk/topo_skaermkort_wmts_DAF?service=WMTS&request=GetTile&version=1.3.0&Layer=topo_skaermkort&style=default&format=image/png&TileMatrixSet=View1&TileMatrix={zoom}&TileRow={y}&TileCol={x}&token=' + dftoken, {
const wmts = L.tileLayer(`https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort_wmts/1.0.0/wmts?username=${ dfUser }&password=${ dfPass }&service=WMTS&request=GetTile&version=1.0.0&Layer=topo_skaermkort&style=default&format=image/png&TileMatrixSet=View1&TileMatrix={zoom}&TileRow={y}&TileCol={x}`, {
attribution: myAttributionText,
crossOrigin: true,
minzoom: 0,
maxzoom: 11,
zoom: function (data) {
return data.z;
}
}).addTo(map);

// Skærmkort [WMS:topo_skaermkort]
const wms = L.tileLayer.wms('https://api.dataforsyningen.dk/topo_skaermkort_DAF?ignoreillegallayers=TRUE', {
const skaermkortServiceWmsUrl = `https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort/1.0.0/wms?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const wms = L.tileLayer.wms(skaermkortServiceWmsUrl, {
transparent: 'TRUE',
layers: 'dtk_skaermkort',
token: dftoken,
format: 'image/png',
attribution: myAttributionText
})
});

// Add scale line to map
L.control.scale({imperial: false}).addTo(map); // disable feet units
Expand Down
15 changes: 8 additions & 7 deletions examples/openlayers/example1.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ <h1>WMTS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
ScaleLine
} from '../lib/openlayers.js';

// Set Dataforsyningen token, replace with your own token
const dftoken = '9ca510be3c4eca89b1333cadbaa60c36';
// Set Datafordeler username/password. Replace with your own
const dfUser = 'QKJBQATHVS'
const dfPass = 'ytxCA8UGM5n0Z*zi'

// Set projection as we are not using the default OpenLayers projections
// You can define it yourself or you can use the proj4 library as done below
Expand Down Expand Up @@ -86,7 +87,7 @@ <h1>WMTS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
const WMTSparser = new WMTSCapabilities();

// Fetches 'topo_skaermkort' capabilites and adds layer to map
const skaermkortCapabilitesUrl = 'https://api.dataforsyningen.dk/topo_skaermkort_wmts_DAF?service=WMTS&request=GetCapabilities&token=' + dftoken
const skaermkortCapabilitesUrl = `https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort_wmts/1.0.0/wmts?username=${ dfUser }&password=${ dfPass }&service=WMTS&request=GetCapabilities`
fetch(skaermkortCapabilitesUrl)
.then(function (response) {
return response.text();
Expand All @@ -111,7 +112,7 @@ <h1>WMTS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
});

// Fetches 'orto_foraar' capabilites and adds layer to map
const ortoCapabilitesUrl = 'https://api.dataforsyningen.dk/orto_foraar_wmts_DAF?service=WMTS&request=GetCapabilities&token=' + dftoken
const ortoCapabilitesUrl = `https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar_wmts/1.0.0/WMTS?username=${ dfUser }&password=${ dfPass }&service=WMTS&request=GetCapabilities`
fetch(ortoCapabilitesUrl)
.then(function (response) {
return response.text();
Expand All @@ -137,7 +138,7 @@ <h1>WMTS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
});

// Create Matrikel overlay
const matrikelServiceUrl = 'https://api.dataforsyningen.dk/MatrikelGaeldendeOgForeloebigWMS_DAF?ignoreillegallayers=TRUE&transparent=TRUE&token=' + dftoken
const matrikelServiceUrl = `https://services.datafordeler.dk/MATRIKLEN2/MatGaeldendeOgForeloebigWMS/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const matrikelLayer = new TileLayer({
visible: false,
title: 'Matrikel',
Expand All @@ -154,15 +155,15 @@ <h1>WMTS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
overlayLayerGroup.getLayers().push(matrikelLayer)

// Create Hill shade overlay
const hillShadeServiceUrl = 'https://api.dataforsyningen.dk/dhm?ignoreillegallayers=TRUE&transparent=TRUE&token=' + dftoken
const hillShadeServiceUrl = `https://services.datafordeler.dk/DHMNedboer/dhm/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const hillShadeLayer = new TileLayer({
visible: false,
title: 'Skyggekort',
type: 'overlay',
source: new TileWMS({
url: hillShadeServiceUrl,
params: {
'LAYERS': 'dhm_terraen_skyggekort_transparent_overdrevet',
'LAYERS': 'dhm_terraen_skyggekort',
'TRANSPARENT': 'TRUE'
}
})
Expand Down
15 changes: 8 additions & 7 deletions examples/openlayers/example2.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ <h1>WMS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
ScaleLine
} from '../lib/openlayers.js';

// Set Dataforsyningen token, replace with your own token
const dftoken = '9ca510be3c4eca89b1333cadbaa60c36';
// Set Datafordeler username/password. Replace with your own
const dfUser = 'QKJBQATHVS'
const dfPass = 'ytxCA8UGM5n0Z*zi'

// Set projection as we are not using the default OpenLayers projections
// You can define it yourself or you can use the proj4 library as done below
Expand Down Expand Up @@ -81,7 +82,7 @@ <h1>WMS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
});

// Create Skærmkort base layer
const skaermkortServiceUrl = 'https://api.dataforsyningen.dk/topo_skaermkort_DAF?ignoreillegallayers=TRUE&token=' + dftoken
const skaermkortServiceUrl = `https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort/1.0.0/wms?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const skaermLayer = new TileLayer({
title: 'Skærmkort',
type: 'base',
Expand All @@ -98,7 +99,7 @@ <h1>WMS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
baseMapLayerGroup.getLayers().push(skaermLayer)

// Create ortofoto base layer
const ortofotoServiceUrl = 'https://api.dataforsyningen.dk/orto_foraar_DAF?ignoreillegallayers=TRUE&token=' + dftoken
const ortofotoServiceUrl = `https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const ortofotoLayer = new TileLayer({
visible: false,
title: 'Ortofoto',
Expand All @@ -116,7 +117,7 @@ <h1>WMS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
baseMapLayerGroup.getLayers().push(ortofotoLayer)

// Create Matrikel overlay
const matrikelServiceUrl = 'https://api.dataforsyningen.dk/MatrikelGaeldendeOgForeloebigWMS_DAF?ignoreillegallayers=TRUE&token=' + dftoken
const matrikelServiceUrl = `https://services.datafordeler.dk/MATRIKLEN2/MatGaeldendeOgForeloebigWMS/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const matrikelLayer = new TileLayer({
visible: false,
title: 'Matrikel',
Expand All @@ -133,15 +134,15 @@ <h1>WMS kort med <a href="https://openlayers.org/">OpenLayers</a></h1>
overlayLayerGroup.getLayers().push(matrikelLayer)

// Create Hill shade overlay
const hillShadeServiceUrl = 'https://api.dataforsyningen.dk/dhm?ignoreillegallayers=TRUE&token=' + dftoken
const hillShadeServiceUrl = `https://services.datafordeler.dk/DHMNedboer/dhm/1.0.0/WMS?username=${ dfUser }&password=${ dfPass }&ignoreillegallayers=TRUE`
const hillShadeLayer = new TileLayer({
visible: false,
title: 'Skyggekort',
type: 'overlay',
source: new TileWMS({
url: hillShadeServiceUrl,
params: {
'LAYERS': 'dhm_terraen_skyggekort_transparent_overdrevet',
'LAYERS': 'dhm_terraen_skyggekort',
'TRANSPARENT': 'TRUE'
}
})
Expand Down
9 changes: 5 additions & 4 deletions examples/openlayers/example3.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ <h1>GSearch type-ahead</h1>
Point
} from '../lib/openlayers.js';

// Set Kortforsyningen token, replace with your own token
var dftoken = '9ca510be3c4eca89b1333cadbaa60c36';
// Set Datafordeler username/password. Replace with your own
const dfUser = 'QKJBQATHVS'
const dfPass = 'ytxCA8UGM5n0Z*zi'

// Set projection as we are not using the default OpenLayers projections
// You can define it yourself or you can use the proj4 library as done below
Expand Down Expand Up @@ -153,7 +154,7 @@ <h1>GSearch type-ahead</h1>
const WMTSparser = new WMTSCapabilities();

// Fetches 'topo_skaermkort' capabilites and adds layer to map
const skaermkortCapabilitesUrl = 'https://api.dataforsyningen.dk/topo_skaermkort_wmts_DAF?service=WMTS&request=GetCapabilities&token=' + dftoken
const skaermkortCapabilitesUrl = `https://services.datafordeler.dk/Dkskaermkort/topo_skaermkort_wmts/1.0.0/wmts?username=${ dfUser }&password=${ dfPass }&service=WMTS&request=GetCapabilities`
fetch(skaermkortCapabilitesUrl)
.then(function (response) {
return response.text();
Expand All @@ -178,7 +179,7 @@ <h1>GSearch type-ahead</h1>
});

// Fetches 'orto_foraar' capabilites and adds layer to map
const ortoCapabilitesUrl = 'https://api.dataforsyningen.dk/orto_foraar_wmts_DAF?service=WMTS&request=GetCapabilities&token=' + dftoken
const ortoCapabilitesUrl = `https://services.datafordeler.dk/GeoDanmarkOrto/orto_foraar_wmts/1.0.0/WMTS?username=${ dfUser }&password=${ dfPass }&service=WMTS&request=GetCapabilities`
fetch(ortoCapabilitesUrl)
.then(function (response) {
return response.text();
Expand Down
Loading

0 comments on commit a3eb660

Please sign in to comment.