@treasuryspatial/map-kit 0.1.14 → 0.1.16

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.
@@ -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,CA2VhF"}
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,CAsWhF"}
@@ -24,6 +24,7 @@ export function createMapThreeLayer(options) {
24
24
  let originResolved = false;
25
25
  let didPrerender = false;
26
26
  let lastMatrix = null;
27
+ let renderTicks = 0;
27
28
  const renderOffscreen = () => {
28
29
  if (renderDisabled)
29
30
  return;
@@ -147,7 +148,7 @@ export function createMapThreeLayer(options) {
147
148
  const layer = {
148
149
  id,
149
150
  type: 'custom',
150
- renderingMode: '2d',
151
+ renderingMode: '3d',
151
152
  onAdd: (map, gl) => {
152
153
  mapRef = map;
153
154
  scene = new THREE.Scene();
@@ -193,6 +194,9 @@ export function createMapThreeLayer(options) {
193
194
  rootGroup.add(meshGroup);
194
195
  if (onInit && renderer && camera)
195
196
  onInit(scene, renderer, camera);
197
+ if (debug) {
198
+ log('onAdd');
199
+ }
196
200
  if (!mercatorOrigin && mapRef && meshGroup) {
197
201
  try {
198
202
  const center = mapRef.getCenter();
@@ -247,6 +251,10 @@ export function createMapThreeLayer(options) {
247
251
  renderOffscreen();
248
252
  }
249
253
  didPrerender = false;
254
+ if (debug && renderTicks < 2) {
255
+ renderTicks += 1;
256
+ log('render tick', { hasMatrix: Boolean(lastMatrix) });
257
+ }
250
258
  renderer.resetState();
251
259
  gl.disable(gl.DEPTH_TEST);
252
260
  gl.depthMask(false);
@@ -304,6 +312,9 @@ export function createMapThreeLayer(options) {
304
312
  if (meshGroup)
305
313
  rootGroup.add(meshGroup);
306
314
  }
315
+ if (mapRef && hasRenderable) {
316
+ mapRef.triggerRepaint();
317
+ }
307
318
  },
308
319
  setOrigin: (origin) => {
309
320
  if (!origin) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasuryspatial/map-kit",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",