@mapvx/web-js 1.3.0-dev.1 → 1.3.0-dev.2

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/umd/index.js CHANGED
@@ -21542,7 +21542,7 @@ var rollbar_umd_min_default = /*#__PURE__*/__webpack_require__.n(rollbar_umd_min
21542
21542
  // version placeholder is replaced with the package version by
21543
21543
  // scripts/inject-build-defines.js. The access token falls back to the MapVX
21544
21544
  // SDK-web Rollbar project token when none is injected at build time.
21545
- var SDK_VERSION = true ? "1.3.0-dev.1" : 0;
21545
+ var SDK_VERSION = true ? "1.3.0-dev.2" : 0;
21546
21546
  var ACCESS_TOKEN = true ? "1e7e62a3edc14868b4098d653d0f33b9" : 0;
21547
21547
  var _rollbarConfig = {
21548
21548
  accessToken: ACCESS_TOKEN,
@@ -21589,7 +21589,7 @@ function logger_toPrimitive(t, r) { if ("object" != logger_typeof(t) || !t) retu
21589
21589
  // by scripts/inject-build-defines.js. The Countly key falls back to the
21590
21590
  // MapVX key when none is injected at build time.
21591
21591
  var IS_DEBUG = true ? false : 0;
21592
- var logger_SDK_VERSION = true ? "1.3.0-dev.1" : 0;
21592
+ var logger_SDK_VERSION = true ? "1.3.0-dev.2" : 0;
21593
21593
  var COUNTLY_API_KEY = true ? "f0c8d3b96d336e857a8628f49dd1baf7d7add0e9" : 0;
21594
21594
  var logger_countly = {
21595
21595
  apiKey: COUNTLY_API_KEY,
@@ -165240,7 +165240,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
165240
165240
  map_defineProperty(_this, "escalatorModelTemplate", undefined);
165241
165241
  map_defineProperty(_this, "escalatorCenter", undefined);
165242
165242
  map_defineProperty(_this, "escalatorCache", {});
165243
- map_defineProperty(_this, "ESCALATOR_MODEL_URL", "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/shared/escalator.glb");
165243
+ map_defineProperty(_this, "ESCALATOR_MODEL_URL", "https://mapvx-glb-assets.s3.us-east-1.amazonaws.com/shared/escalator_up.glb");
165244
165244
  /**
165245
165245
  * Number of lights to use for the escalators
165246
165246
  *
@@ -165691,10 +165691,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
165691
165691
  var sz = (target.y - refMercator.y) / meterScale;
165692
165692
  var pivot = new Group();
165693
165693
  pivot.position.set(sx, 0, sz);
165694
- pivot.rotation.y = Math.PI / 2 - pos.bearing;
165695
- pivot.scale.set(0.3, 0.3, 0.3);
165694
+ pivot.rotation.y = -pos.bearing;
165695
+ pivot.scale.set(1, 1, 1);
165696
165696
  var model = this.escalatorModelTemplate.clone();
165697
- model.position.set(-this.escalatorCenter.x, -this.escalatorCenter.y - 3, -this.escalatorCenter.z);
165697
+ model.position.set(-this.escalatorCenter.x, -this.escalatorCenter.y + 0.7, -this.escalatorCenter.z);
165698
165698
  pivot.add(model);
165699
165699
  this.escalatorScene.add(pivot);
165700
165700
  }
@@ -165733,7 +165733,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
165733
165733
  // across tile boundaries, a MultiLineString. The previous code assumed
165734
165734
  // LineString and read coords[0]/coords[n-1] as [lng,lat], producing
165735
165735
  // NaN for MultiLineString (coordinates is number[][][]). Normalize both
165736
- // shapes to a list of line parts (Position[][]).
165736
+ // shapes to a list of line parts (Position[][]) and flatten them into a
165737
+ // single continuous list of points so we still derive ONE midpoint per
165738
+ // feature (a MultiLineString is just one escalator line split across
165739
+ // tiles, not several escalators).
165737
165740
  var lineParts = void 0;
165738
165741
  if (geom.type === "LineString") {
165739
165742
  lineParts = [geom.coordinates];
@@ -165742,32 +165745,22 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
165742
165745
  } else {
165743
165746
  continue;
165744
165747
  }
165745
- var _iterator5 = map_createForOfIteratorHelper(lineParts),
165746
- _step5;
165747
- try {
165748
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
165749
- var coords = _step5.value;
165750
- if (!coords || coords.length < 2) continue;
165751
- var start = coords[0];
165752
- var end = coords[coords.length - 1];
165753
- var midLng = (start[0] + end[0]) / 2;
165754
- var midLat = (start[1] + end[1]) / 2;
165755
- var bearing = Math.atan2(end[0] - start[0], end[1] - start[1]);
165756
-
165757
- // Skip any non-finite result so a bad feature can never poison the
165758
- // cache (and later crash MercatorCoordinate.fromLngLat).
165759
- if (!Number.isFinite(midLng) || !Number.isFinite(midLat) || !Number.isFinite(bearing)) continue;
165760
- allMids.push({
165761
- lng: midLng,
165762
- lat: midLat,
165763
- bearing: bearing
165764
- });
165765
- }
165766
- } catch (err) {
165767
- _iterator5.e(err);
165768
- } finally {
165769
- _iterator5.f();
165770
- }
165748
+ var coords = lineParts.flat();
165749
+ if (coords.length < 2) continue;
165750
+ var start = coords[0];
165751
+ var end = coords[coords.length - 1];
165752
+ var midLng = (start[0] + end[0]) / 2;
165753
+ var midLat = (start[1] + end[1]) / 2;
165754
+ var bearing = Math.atan2(end[0] - start[0], end[1] - start[1]);
165755
+
165756
+ // Skip any non-finite result so a bad feature can never poison the
165757
+ // cache (and later crash MercatorCoordinate.fromLngLat).
165758
+ if (!Number.isFinite(midLng) || !Number.isFinite(midLat) || !Number.isFinite(bearing)) continue;
165759
+ allMids.push({
165760
+ lng: midLng,
165761
+ lat: midLat,
165762
+ bearing: bearing
165763
+ });
165771
165764
  }
165772
165765
 
165773
165766
  // Merge points within ~15m of each other into one
@@ -165862,25 +165855,25 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
165862
165855
  });
165863
165856
  if (!roomFeatures.length) return null;
165864
165857
  var paths = [];
165865
- var _iterator6 = map_createForOfIteratorHelper(roomFeatures),
165866
- _step6;
165858
+ var _iterator5 = map_createForOfIteratorHelper(roomFeatures),
165859
+ _step5;
165867
165860
  try {
165868
165861
  var _loop = function _loop() {
165869
165862
  var _f$properties5;
165870
- var f = _step6.value;
165863
+ var f = _step5.value;
165871
165864
  var z = (_f$properties5 = f.properties) !== null && _f$properties5 !== void 0 && _f$properties5.height ? Number(f.properties.height) : 5;
165872
165865
  var geom = f.geometry;
165873
165866
  var polygons = geom.type === "Polygon" ? [geom.coordinates] : geom.type === "MultiPolygon" ? geom.coordinates : [];
165874
- var _iterator7 = map_createForOfIteratorHelper(polygons),
165875
- _step7;
165867
+ var _iterator6 = map_createForOfIteratorHelper(polygons),
165868
+ _step6;
165876
165869
  try {
165877
- for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
165878
- var rings = _step7.value;
165879
- var _iterator8 = map_createForOfIteratorHelper(rings),
165880
- _step8;
165870
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
165871
+ var rings = _step6.value;
165872
+ var _iterator7 = map_createForOfIteratorHelper(rings),
165873
+ _step7;
165881
165874
  try {
165882
- for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
165883
- var ring = _step8.value;
165875
+ for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
165876
+ var ring = _step7.value;
165884
165877
  paths.push({
165885
165878
  path: ring.map(function (_ref) {
165886
165879
  var _ref2 = map_slicedToArray(_ref, 2),
@@ -165891,24 +165884,24 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
165891
165884
  });
165892
165885
  }
165893
165886
  } catch (err) {
165894
- _iterator8.e(err);
165887
+ _iterator7.e(err);
165895
165888
  } finally {
165896
- _iterator8.f();
165889
+ _iterator7.f();
165897
165890
  }
165898
165891
  }
165899
165892
  } catch (err) {
165900
- _iterator7.e(err);
165893
+ _iterator6.e(err);
165901
165894
  } finally {
165902
- _iterator7.f();
165895
+ _iterator6.f();
165903
165896
  }
165904
165897
  };
165905
- for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
165898
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
165906
165899
  _loop();
165907
165900
  }
165908
165901
  } catch (err) {
165909
- _iterator6.e(err);
165902
+ _iterator5.e(err);
165910
165903
  } finally {
165911
- _iterator6.f();
165904
+ _iterator5.f();
165912
165905
  }
165913
165906
  return new path_layer(map_objectSpread(map_objectSpread({}, props), {}, {
165914
165907
  id: "".concat(props.id, "-paths"),
@@ -166707,11 +166700,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
166707
166700
  // lands immediately before it, so a bucket processed later paints above
166708
166701
  // the ones processed earlier. Canonical order keeps
166709
166702
  // belowLabels < aboveBasemap < top regardless of circle insertion order.
166710
- var _iterator9 = map_createForOfIteratorHelper(CIRCLE_RENDER_ORDERS),
166711
- _step9;
166703
+ var _iterator8 = map_createForOfIteratorHelper(CIRCLE_RENDER_ORDERS),
166704
+ _step8;
166712
166705
  try {
166713
- for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
166714
- var order = _step9.value;
166706
+ for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
166707
+ var order = _step8.value;
166715
166708
  if (!ordersInUse.has(order)) continue;
166716
166709
  var ids = circleLayerIdsFor(order);
166717
166710
  var beforeId = this.circleBeforeIdFor(order);
@@ -166749,9 +166742,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
166749
166742
  }
166750
166743
  }
166751
166744
  } catch (err) {
166752
- _iterator9.e(err);
166745
+ _iterator8.e(err);
166753
166746
  } finally {
166754
- _iterator9.f();
166747
+ _iterator8.f();
166755
166748
  }
166756
166749
  } catch (error) {
166757
166750
  // Style may not be loaded yet; the styledata listener re-adds the layers
@@ -167019,11 +167012,11 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
167019
167012
  var minLng;
167020
167013
  var maxLat;
167021
167014
  var maxLng;
167022
- var _iterator0 = map_createForOfIteratorHelper(coordinates),
167023
- _step0;
167015
+ var _iterator9 = map_createForOfIteratorHelper(coordinates),
167016
+ _step9;
167024
167017
  try {
167025
- for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
167026
- var _coord = _step0.value;
167018
+ for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
167019
+ var _coord = _step9.value;
167027
167020
  var lat = _coord.lat,
167028
167021
  lng = _coord.lng;
167029
167022
  minLat = minLat === undefined ? lat : Math.min(minLat, lat);
@@ -167032,9 +167025,9 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
167032
167025
  maxLng = maxLng === undefined ? lng : Math.max(maxLng, lng);
167033
167026
  }
167034
167027
  } catch (err) {
167035
- _iterator0.e(err);
167028
+ _iterator9.e(err);
167036
167029
  } finally {
167037
- _iterator0.f();
167030
+ _iterator9.f();
167038
167031
  }
167039
167032
  var bounds = [minLng !== null && minLng !== void 0 ? minLng : 0, minLat !== null && minLat !== void 0 ? minLat : 0, maxLng !== null && maxLng !== void 0 ? maxLng : 0, maxLat !== null && maxLat !== void 0 ? maxLat : 0];
167040
167033
 
@@ -167239,7 +167232,7 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
167239
167232
  var _this18 = this;
167240
167233
  this.map.on("click", /*#__PURE__*/function () {
167241
167234
  var _ref6 = map_asyncToGenerator(/*#__PURE__*/map_regenerator().m(function _callee3(e) {
167242
- var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref7, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator1, _step1, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t2;
167235
+ var features, roomFeatures, touchedFeature, ref, _clickedPlace, _ref7, _clickedPlace$mapvxId, _clickedPlace2, _clickedPlace3, clickedPlace, _iterator0, _step0, potentialParentPlace, cachedSubPlaces, cachedPlaces, clickedPlaceId, _t2;
167243
167236
  return map_regenerator().w(function (_context3) {
167244
167237
  while (1) switch (_context3.p = _context3.n) {
167245
167238
  case 0:
@@ -167264,15 +167257,15 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
167264
167257
  _context3.n = 7;
167265
167258
  break;
167266
167259
  }
167267
- _iterator1 = map_createForOfIteratorHelper(_this18.potentialParentPlaces);
167260
+ _iterator0 = map_createForOfIteratorHelper(_this18.potentialParentPlaces);
167268
167261
  _context3.p = 1;
167269
- _iterator1.s();
167262
+ _iterator0.s();
167270
167263
  case 2:
167271
- if ((_step1 = _iterator1.n()).done) {
167264
+ if ((_step0 = _iterator0.n()).done) {
167272
167265
  _context3.n = 4;
167273
167266
  break;
167274
167267
  }
167275
- potentialParentPlace = _step1.value;
167268
+ potentialParentPlace = _step0.value;
167276
167269
  cachedSubPlaces = _this18.repository.getCachedSubPlaces(potentialParentPlace.mapvxId);
167277
167270
  if (!cachedSubPlaces) {
167278
167271
  _context3.n = 3;
@@ -167295,10 +167288,10 @@ var InternalMapVXMap = /*#__PURE__*/function (_Loggeable) {
167295
167288
  case 5:
167296
167289
  _context3.p = 5;
167297
167290
  _t2 = _context3.v;
167298
- _iterator1.e(_t2);
167291
+ _iterator0.e(_t2);
167299
167292
  case 6:
167300
167293
  _context3.p = 6;
167301
- _iterator1.f();
167294
+ _iterator0.f();
167302
167295
  return _context3.f(6);
167303
167296
  case 7:
167304
167297
  if (!(clickedPlace === undefined)) {