@treasuryspatial/map-kit 0.1.13 → 0.1.15

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,CA8VhF"}
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,CAmWhF"}
@@ -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;
@@ -31,9 +32,6 @@ export function createMapThreeLayer(options) {
31
32
  return;
32
33
  if (!hasRenderable)
33
34
  return;
34
- if (lastMatrix) {
35
- applyMatrix(lastMatrix);
36
- }
37
35
  if (!mercatorOrigin && mapRef && !originResolved) {
38
36
  try {
39
37
  const center = mapRef.getCenter();
@@ -150,7 +148,7 @@ export function createMapThreeLayer(options) {
150
148
  const layer = {
151
149
  id,
152
150
  type: 'custom',
153
- renderingMode: '2d',
151
+ renderingMode: '3d',
154
152
  onAdd: (map, gl) => {
155
153
  mapRef = map;
156
154
  scene = new THREE.Scene();
@@ -196,6 +194,9 @@ export function createMapThreeLayer(options) {
196
194
  rootGroup.add(meshGroup);
197
195
  if (onInit && renderer && camera)
198
196
  onInit(scene, renderer, camera);
197
+ if (debug) {
198
+ log('onAdd');
199
+ }
199
200
  if (!mercatorOrigin && mapRef && meshGroup) {
200
201
  try {
201
202
  const center = mapRef.getCenter();
@@ -250,6 +251,10 @@ export function createMapThreeLayer(options) {
250
251
  renderOffscreen();
251
252
  }
252
253
  didPrerender = false;
254
+ if (debug && renderTicks < 2) {
255
+ renderTicks += 1;
256
+ log('render tick', { hasMatrix: Boolean(lastMatrix) });
257
+ }
253
258
  renderer.resetState();
254
259
  gl.disable(gl.DEPTH_TEST);
255
260
  gl.depthMask(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasuryspatial/map-kit",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",