@treasuryspatial/map-kit 0.1.20 → 0.1.21
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/mapThreeLayer.d.ts.map +1 -1
- package/dist/mapThreeLayer.js +17 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapThreeLayer.d.ts","sourceRoot":"","sources":["../src/mapThreeLayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IAC3F,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"mapThreeLayer.d.ts","sourceRoot":"","sources":["../src/mapThreeLayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IAC3F,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CA+gBhF"}
|
package/dist/mapThreeLayer.js
CHANGED
|
@@ -80,6 +80,18 @@ export function createMapThreeLayer(options) {
|
|
|
80
80
|
renderer.setRenderTarget(renderTarget);
|
|
81
81
|
renderer.resetState();
|
|
82
82
|
const gl = renderer.getContext();
|
|
83
|
+
if (targetWidth <= 0 || targetHeight <= 0) {
|
|
84
|
+
renderer.setRenderTarget(null);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const fbStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
|
|
88
|
+
if (fbStatus !== gl.FRAMEBUFFER_COMPLETE) {
|
|
89
|
+
if (debug) {
|
|
90
|
+
log(`Framebuffer incomplete (prerender)`, fbStatus);
|
|
91
|
+
}
|
|
92
|
+
renderer.setRenderTarget(null);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
83
95
|
gl.disable(gl.SCISSOR_TEST);
|
|
84
96
|
gl.disable(gl.STENCIL_TEST);
|
|
85
97
|
gl.colorMask(true, true, true, true);
|
|
@@ -183,7 +195,7 @@ export function createMapThreeLayer(options) {
|
|
|
183
195
|
canvas: map.getCanvas(),
|
|
184
196
|
context: gl,
|
|
185
197
|
antialias: true,
|
|
186
|
-
logarithmicDepthBuffer:
|
|
198
|
+
logarithmicDepthBuffer: false,
|
|
187
199
|
alpha: true,
|
|
188
200
|
premultipliedAlpha: true,
|
|
189
201
|
});
|
|
@@ -202,8 +214,11 @@ export function createMapThreeLayer(options) {
|
|
|
202
214
|
});
|
|
203
215
|
renderTarget.texture.format = THREE.RGBAFormat;
|
|
204
216
|
renderTarget.texture.type = THREE.UnsignedByteType;
|
|
205
|
-
renderTarget.texture.colorSpace = THREE.
|
|
217
|
+
renderTarget.texture.colorSpace = THREE.LinearSRGBColorSpace;
|
|
206
218
|
renderTarget.texture.premultiplyAlpha = true;
|
|
219
|
+
renderTarget.texture.generateMipmaps = false;
|
|
220
|
+
renderTarget.texture.minFilter = THREE.LinearFilter;
|
|
221
|
+
renderTarget.texture.magFilter = THREE.LinearFilter;
|
|
207
222
|
log('renderTarget', { width: targetWidth, height: targetHeight });
|
|
208
223
|
const vsrc = `
|
|
209
224
|
attribute vec2 a_pos;
|