chiitiler 1.21.0 → 1.21.1
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/render/index.js +10 -0
- package/package.json +1 -1
package/dist/render/index.js
CHANGED
|
@@ -53,6 +53,10 @@ async function getRenderedTile({ stylejson, z, x, y, tileSize, cache, margin, ex
|
|
|
53
53
|
width: 512,
|
|
54
54
|
height: 512,
|
|
55
55
|
channels: 4,
|
|
56
|
+
// maplibre-native returns premultiplied alpha; tell sharp so it
|
|
57
|
+
// unpremultiplies to straight alpha, otherwise antialiased edges
|
|
58
|
+
// (e.g. white text-halo) come out gray on transparent backgrounds.
|
|
59
|
+
premultiplied: true,
|
|
56
60
|
},
|
|
57
61
|
}).resize(256, 256);
|
|
58
62
|
}
|
|
@@ -62,6 +66,7 @@ async function getRenderedTile({ stylejson, z, x, y, tileSize, cache, margin, ex
|
|
|
62
66
|
width: tileSize,
|
|
63
67
|
height: tileSize,
|
|
64
68
|
channels: 4,
|
|
69
|
+
premultiplied: true,
|
|
65
70
|
},
|
|
66
71
|
});
|
|
67
72
|
}
|
|
@@ -71,6 +76,7 @@ async function getRenderedTile({ stylejson, z, x, y, tileSize, cache, margin, ex
|
|
|
71
76
|
width: tileSize + margin,
|
|
72
77
|
height: tileSize + margin,
|
|
73
78
|
channels: 4,
|
|
79
|
+
premultiplied: true,
|
|
74
80
|
},
|
|
75
81
|
})
|
|
76
82
|
.extract({
|
|
@@ -125,6 +131,8 @@ async function getRenderedClip({ stylejson, bbox, size, cache, ext, quality, })
|
|
|
125
131
|
width,
|
|
126
132
|
height,
|
|
127
133
|
channels: 4,
|
|
134
|
+
// see getRenderedTile: maplibre-native returns premultiplied alpha
|
|
135
|
+
premultiplied: true,
|
|
128
136
|
},
|
|
129
137
|
});
|
|
130
138
|
switch (ext) {
|
|
@@ -152,6 +160,8 @@ async function getRenderedCamera(options) {
|
|
|
152
160
|
width: options.width,
|
|
153
161
|
height: options.height,
|
|
154
162
|
channels: 4,
|
|
163
|
+
// see getRenderedTile: maplibre-native returns premultiplied alpha
|
|
164
|
+
premultiplied: true,
|
|
155
165
|
},
|
|
156
166
|
});
|
|
157
167
|
switch (options.ext) {
|