Skip to content

Commit

Permalink
Merge pull request #2 from SDFIdk/new-stylefiles
Browse files Browse the repository at this point in the history
New stylefiles
  • Loading branch information
Gebuz authored Nov 20, 2024
2 parents 37c511b + e92bb35 commit 15d92c8
Show file tree
Hide file tree
Showing 14 changed files with 3,968 additions and 1,039 deletions.
7 changes: 7 additions & 0 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Developing

## Building test files
Start by installing the dependencies with `npm install`. Then create a config with a dataforsyningen.dk token in the root folder (see `config.example.js` for an example config). After that you can build the test files with `npm run test` which will run a server that serves all the test html files at `localhost:8000/test/`.

## Building glyphs from fonts
To build glyphs from the fonts in the `fonts` folder, install the depedencies with `npm install` and then run `npm run build-glyphs`.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Vector Tiles Assets

## Building test files
Start by installing the dependencies with `npm install`. Then create a config with a dataforsyningen.dk token in the root folder (see `config.example.js` for an example config). After that you can build the test files with `npm run test` which will run a server that serves all the test html files at `localhost:8000/test/`.

## Building glyphs from fonts
To build glyphs from the fonts in the `fonts` folder, install the depedencies with `npm install` and then run `npm run build-glyphs`.
Assets for vector tiles provided by Klimadatastyrelsen.
4 changes: 3 additions & 1 deletion esbuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const frameworks = [
projections: ['3857']
}
]
const defaultProjection = '25832'

// Helper functions
async function readFile(file) {
Expand Down Expand Up @@ -79,7 +80,8 @@ for(const framework of frameworks) {
const files = await readdir(`${styleDir}/${topFolder}/`)
for(const file of files) {
const fileName = file.slice(0, -5)
const projection = file.match(/^[^_]+/)[0]
const match = file.match(/^\d+(?=_)/ )
const projection = match? match[0] : defaultProjection
if (!framework.projections || framework.projections.includes(projection)) {
try {
const filePath = `${process.env.NODE_ENV === 'production' ? repoPrefix : ''}/${styleDir}/${topFolder}/${file}`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dataforsyningen/vector_tiles_assets",
"version": "0.1.2",
"version": "0.2.0",
"description": "Klimadatastyrelsen's assets for vector tiles.",
"main": "./public/index.html",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/test/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export const projectionDefaults = {
'25832': {
name: 'EPSG:25832',
projection: '+proj=utm +zone=32 +ellps=GRS80 +units=m +no_defs',
extent: [120000, 5661139.2, 958860.8, 6500000],
extent: [139000, 5661139.2, 977860.8, 6500000],
center: [566100, 6217900],
resolutions: [3276.8, 1638.4, 819.2, 409.6, 204.8, 102.4, 51.2, 25.6, 12.8, 6.4, 3.2, 1.6, 0.8, 0.4, 0.2, 0.1],
zoom: 7,
Expand Down
Loading

0 comments on commit 15d92c8

Please sign in to comment.