Skip to content

Commit

Permalink
Merge pull request #119 from SDFIdk/ccby
Browse files Browse the repository at this point in the history
update attribution
  • Loading branch information
Gebuz authored Sep 20, 2024
2 parents 346183b + 2e2e4cc commit c775c9a
Show file tree
Hide file tree
Showing 34 changed files with 270 additions and 174 deletions.
4 changes: 2 additions & 2 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ I konsolen:
```
npm run dev
```
Det starter en udviklingsserver, så du kan åbne eksempel-sider i en browser; f.eks. på [localhost:8000/examples/simple.html].
Det starter en udviklingsserver, så du kan åbne eksempel-sider i en browser; f.eks. på [localhost:8000/docs/simple.html].

Så længe den kører, vil den automatisk bygge med nye ændringer du laver i `/src`.
HTML-eksemplerne i `/examples` bliver dog ikke opdateret, med mindre du kører `npm run build`
HTML-eksemplerne i `/docs` bliver dog ikke opdateret, med mindre du kører `npm run build`

## Byg til prod

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Før brug skal man oprette en bruger på [Dataforsyningen](https://dataforsyning
1. Opret en bruger på [Dataforsyningen](https://www.dataforsyningen.dk)
2. Log ind på dataforsyningen.dk med din nye bruger, og opret en token.
3. Indsæt `<script>`-tag på din hjemmeside
- Benyt enten vores CDN: `<script type="module">import {Initialize} from "https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.2.0"</script>`
- Benyt enten vores CDN: `<script type="module">import {Initialize} from "https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.3.0"</script>`
- Eller hav filen liggende på din egen server: `<script src="/path/to/index.js"></script>`
4. Indsæt `<div id="map" class="geomap" data-token="...">`-tag, dér hvor du vil have kortet.
- Husk at indsætte din egen token i `data-token`-attributten.
Expand Down Expand Up @@ -77,7 +77,7 @@ Brug OKAPI CSS og JS direkte fra CDN:
```html
<head>
...
<link href="https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.2.0/dist/okapi.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.3.0/dist/okapi.min.css" rel="stylesheet">
...
</head>
<body>
Expand All @@ -89,7 +89,7 @@ Brug OKAPI CSS og JS direkte fra CDN:
</div>

<script type="module">
import { Initialize } from 'https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.2.0'
import { Initialize } from 'https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.3.0'
new Initialize({})
</script>

Expand All @@ -98,7 +98,7 @@ Brug OKAPI CSS og JS direkte fra CDN:

### CSS

Vores standard styling kan findes her: https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.2.0/dist/okapi.min.css
Vores standard styling kan findes her: https://cdn.jsdelivr.net/npm/@dataforsyningen/okapi@2.3.0/dist/okapi.min.css

## Anvendelse

Expand Down
16 changes: 8 additions & 8 deletions dist/okapi.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/okapi.css.map

Large diffs are not rendered by default.

86 changes: 51 additions & 35 deletions dist/okapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -25176,32 +25176,12 @@ var Resolutions = [1638.4, 819.2, 409.6, 204.8, 102.4, 51.2, 25.6, 12.8, 6.4, 3.
var MatrixIds = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13"];
var Size = [256, 256];

// src/utility/IsMobile.js
var Android = function() {
return navigator.userAgent.match(/Android/i) && navigator.userAgent.match(/Mobile/i);
};
var BlackBerry = function() {
return navigator.userAgent.match(/BlackBerry/i);
};
var iOS = function() {
return navigator.userAgent.match(/iPhone|iPod/i);
};
var Opera = function() {
return navigator.userAgent.match(/Opera Mini/i);
};
var Windows = function() {
return navigator.userAgent.match(/IEMobile/i);
};
var any = function() {
return Android() || BlackBerry() || iOS() || Opera() || Windows();
};

// src/CreateLayer.js
var kfText = any() ? "SDFI" : "Styrelsen for Dataforsyning og Infrastruktur";
var kfLink = "https://download.dataforsyningen.dk/content/vilk%C3%A5r-og-betingelser";
var kfAttributionText = '&copy; <a target="_blank" href="' + kfLink + '">' + kfText + "</a>";
var dfLink = "https://datafordeler.dk/vejledning/brugervilkaar/sdfi-geografiske-data/";
var dfAttributionText = '&copy; <a target="_blank" href="' + dfLink + '">' + kfText + "</a>";
var ccbyText = "(CC BY)";
var ccbyLink = "https://creativecommons.org/licenses/by/4.0/deed.da";
var createAttribution = function(link, text) {
return '<a target="_blank" href="' + ccbyLink + '">' + ccbyText + '</a> <a target="_blank" href="' + link + '">' + text + "</a>";
};
var createUrl = function(service, auth) {
if (auth.source === "kf") {
const baseUrl = "https://api.dataforsyningen.dk/";
Expand All @@ -25227,7 +25207,7 @@ var createLayer2 = function(opt) {
const matrixSet = opt.matrixSet;
const format = opt.format || "";
const tileGrid = opt.tileGrid;
const attributionText = opt.auth.source === "kf" ? kfAttributionText : opt.auth.source === "df" ? dfAttributionText : opt.attribution;
const attributionText = createAttribution(opt.attribution.link, opt.attribution.text);
let source = null;
if (type === "WMTS") {
source = new WMTS_default2({
Expand Down Expand Up @@ -25419,7 +25399,11 @@ var Map2 = class {
matrixSet: "View1",
format: "image/jpeg",
tileGrid: dfTileGrid,
auth: dfAuth
auth: dfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/962",
text: "KDS"
}
}));
layers.push(createLayer2({
name: "dtk_skaermkort_daempet",
Expand All @@ -25431,7 +25415,11 @@ var Map2 = class {
matrixSet: "View1",
format: "image/jpeg",
tileGrid: dfTileGrid,
auth: dfAuth
auth: dfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/962",
text: "KDS"
}
}));
layers.push(createLayer2({
name: "orto_foraar",
Expand All @@ -25444,7 +25432,11 @@ var Map2 = class {
matrixSet: "KortforsyningTilingDK",
format: "image/jpeg",
tileGrid: dfTileGrid,
auth: dfAuth
auth: dfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/981",
text: "GeoDanmark"
}
}));
} else if (this._token) {
layers.push(createLayer2({
Expand All @@ -25457,7 +25449,11 @@ var Map2 = class {
matrixSet: "View1",
format: "image/jpeg",
tileGrid: kfTileGrid,
auth: kfAuth
auth: kfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/962",
text: "KDS"
}
}));
layers.push(createLayer2({
name: "dtk_skaermkort_daempet",
Expand All @@ -25469,7 +25465,11 @@ var Map2 = class {
matrixSet: "View1",
format: "image/jpeg",
tileGrid: kfTileGrid,
auth: kfAuth
auth: kfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/962",
text: "KDS"
}
}));
layers.push(createLayer2({
name: "orto_foraar",
Expand All @@ -25482,7 +25482,11 @@ var Map2 = class {
matrixSet: "KortforsyningTilingDK",
format: "image/jpeg",
tileGrid: kfTileGrid,
auth: kfAuth
auth: kfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/981",
text: "GeoDanmark"
}
}));
}
if (this._token) {
Expand All @@ -25494,7 +25498,11 @@ var Map2 = class {
service: "forvaltning2",
layer: "basis_kort",
format: "image/png",
auth: kfAuth
auth: kfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/2680",
text: "KDS"
}
}));
layers.push(createLayer2({
name: "kommunikation",
Expand All @@ -25504,7 +25512,11 @@ var Map2 = class {
service: "kommunikation",
layer: "Kommunikationskort",
format: "image/png",
auth: kfAuth
auth: kfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/4690",
text: "KDS"
}
}));
layers.push(createLayer2({
name: "natur_friluftskort",
Expand All @@ -25516,7 +25528,11 @@ var Map2 = class {
matrixSet: "View1",
format: "image/jpeg",
tileGrid: kfTileGrid2,
auth: kfAuth
auth: kfAuth,
attribution: {
link: "https://dataforsyningen.dk/data/2683",
text: "KDS"
}
}));
}
const overlays = [];
Expand Down
6 changes: 3 additions & 3 deletions dist/okapi.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit c775c9a

Please sign in to comment.