@tinkatinka/static-map 2.1.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base64img.js +1 -2
- package/dist/compactmap.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +4 -1
- package/package.json +13 -13
package/dist/base64img.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const base64img = async (url, mimetype = 'image/png', userAgent = 'StaticMap/1.0') => {
|
|
1
|
+
const base64img = async (url, mimetype = 'image/png', userAgent = 'StaticMap/2') => {
|
|
3
2
|
const response = await fetch(url, {
|
|
4
3
|
headers: {
|
|
5
4
|
'User-Agent': userAgent
|
package/dist/compactmap.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const compactMap: <T, R>(array: T
|
|
1
|
+
export declare const compactMap: <T, R>(array: Array<T>, func: (value: T, idx: number) => R | undefined) => Array<R>;
|
|
2
2
|
declare global {
|
|
3
3
|
interface Array<T> {
|
|
4
4
|
compactMap<R>(func: (value: T, idx: number) => R | undefined): Array<R>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import Canvas from 'canvas';
|
|
3
2
|
import type { SetOptional, PartialDeep } from 'type-fest';
|
|
4
3
|
export interface LatLng {
|
|
@@ -60,7 +59,7 @@ export interface StaticMapText {
|
|
|
60
59
|
anchor: LatLng;
|
|
61
60
|
options: StaticMapTextOptions;
|
|
62
61
|
}
|
|
63
|
-
export interface StaticMapTextOptions extends CanvasTextDrawingStyles, StrokeFillOptions {
|
|
62
|
+
export interface StaticMapTextOptions extends SetOptional<CanvasTextDrawingStyles, 'letterSpacing' | 'wordSpacing'>, StrokeFillOptions {
|
|
64
63
|
px: number;
|
|
65
64
|
py: number;
|
|
66
65
|
maxWidth?: number;
|
package/dist/index.js
CHANGED
|
@@ -46,10 +46,13 @@ export class StaticMap {
|
|
|
46
46
|
direction: 'inherit',
|
|
47
47
|
font: '12px sans-serif',
|
|
48
48
|
fontKerning: 'auto',
|
|
49
|
+
fontStretch: 'normal',
|
|
50
|
+
fontVariantCaps: 'normal',
|
|
49
51
|
lineWidth: 1.0,
|
|
50
52
|
lineCap: 'round',
|
|
51
53
|
lineJoin: 'round',
|
|
52
|
-
fillStyle: 'black'
|
|
54
|
+
fillStyle: 'black',
|
|
55
|
+
textRendering: 'auto'
|
|
53
56
|
};
|
|
54
57
|
static defaultScaleOptions = {
|
|
55
58
|
units: 'metric',
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinkatinka/static-map",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Render static map images",
|
|
5
5
|
"author": "Florian Gmeiner <florian@tinkatinka.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
|
+
"engines": {
|
|
11
|
+
"node": ">=18.0.0"
|
|
12
|
+
},
|
|
10
13
|
"files": [
|
|
11
14
|
"dist"
|
|
12
15
|
],
|
|
@@ -26,27 +29,24 @@
|
|
|
26
29
|
"scripts": {
|
|
27
30
|
"build": "tsc -p tsconfig.build.json",
|
|
28
31
|
"clean": "rm -rf dist/*",
|
|
29
|
-
"lint": "eslint
|
|
30
|
-
"test": "tsc -p tsconfig.test.json && node --experimental-vm-modules --no-warnings --test --test-reporter=spec
|
|
32
|
+
"lint": "eslint",
|
|
33
|
+
"test": "tsc -p tsconfig.test.json && node --experimental-vm-modules --no-warnings --test --test-reporter=spec"
|
|
31
34
|
},
|
|
32
35
|
"browser": {
|
|
33
36
|
"node-fetch": false
|
|
34
37
|
},
|
|
35
38
|
"dependencies": {
|
|
36
|
-
"canvas": "^
|
|
37
|
-
"cross-fetch": "^4.0.0",
|
|
39
|
+
"canvas": "^3.1.0",
|
|
38
40
|
"lodash-es": "^4.17.21"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
43
|
+
"@eslint/js": "^9.9.0",
|
|
44
|
+
"@types/eslint__js": "^8.42.3",
|
|
41
45
|
"@types/lodash-es": "^4.17.12",
|
|
42
|
-
"@types/node": "^
|
|
43
|
-
"
|
|
44
|
-
"eslint": "^8.0.1",
|
|
45
|
-
"eslint-plugin-import": "^2.23.4",
|
|
46
|
+
"@types/node": "^22.5.0",
|
|
47
|
+
"eslint": "^9.9.0",
|
|
46
48
|
"type-fest": "^4.6.0",
|
|
47
|
-
"typescript": "^5.
|
|
48
|
-
|
|
49
|
-
"peerDependencies": {
|
|
50
|
-
"canvas": "^2.8.0"
|
|
49
|
+
"typescript": "^5.5.4",
|
|
50
|
+
"typescript-eslint": "^8.2.0"
|
|
51
51
|
}
|
|
52
52
|
}
|