venue-js 1.8.0-next.2 → 1.8.0-next.3

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/index.d.mts CHANGED
@@ -48,7 +48,6 @@ declare class TextSpriteMarker extends BaseObject {
48
48
  _updatePosition(): void;
49
49
  _animation(): void;
50
50
  setText(text: string): void;
51
- setAltitude(altitude: number): this;
52
51
  }
53
52
 
54
53
  type ImageMarkerOptions = BaseObjectOptionType & {
package/dist/index.d.ts CHANGED
@@ -48,7 +48,6 @@ declare class TextSpriteMarker extends BaseObject {
48
48
  _updatePosition(): void;
49
49
  _animation(): void;
50
50
  setText(text: string): void;
51
- setAltitude(altitude: number): this;
52
51
  }
53
52
 
54
53
  type ImageMarkerOptions = BaseObjectOptionType & {
package/dist/index.js CHANGED
@@ -5498,10 +5498,9 @@ var Element3DRenderer = class extends EventTarget {
5498
5498
  const color = feature4.properties.style.polygonFill ?? colorOptions ?? "#ffffff";
5499
5499
  if (color === "transparent") return;
5500
5500
  const material = this.getOrCreateMaterialByColor(color);
5501
- const altitude = 0;
5501
+ const altitude = MULTIORDINAL_HEIGHT_METER * feature4.properties.ordinal;
5502
5502
  const height = feature4.properties.height ?? heightOptions ?? HEIGHT_METER;
5503
- const levelBottomHeight = MULTIORDINAL_HEIGHT_METER * feature4.properties.ordinal;
5504
- const bottomHeight = levelBottomHeight + (feature4.properties.bottomHeight ?? bottomHeightOptions ?? 0);
5503
+ const bottomHeight = feature4.properties.bottomHeight ?? bottomHeightOptions ?? 0;
5505
5504
  const extrudedPolygon = this.threeLayer.toExtrudePolygon(
5506
5505
  offsetFeature,
5507
5506
  { asynchronous: true, ...options, height, bottomHeight, altitude },
@@ -5966,10 +5965,10 @@ var Marker2DRenderer = class extends EventTarget {
5966
5965
  marker.addTo(this.map);
5967
5966
  return marker;
5968
5967
  };
5969
- createTextMarker = (position, label, options) => {
5968
+ createTextMarker = (position, ordinal, label, options) => {
5970
5969
  return null;
5971
5970
  };
5972
- createImageMarker = (position, src, options) => {
5971
+ createImageMarker = (position, ordinal, src, options) => {
5973
5972
  return null;
5974
5973
  };
5975
5974
  removeMarker = (marker) => {
@@ -6147,8 +6146,10 @@ var TextSpriteMarker = class extends import_maptalks9.BaseObject {
6147
6146
  const options = this.getOptions();
6148
6147
  const layer = options.layer;
6149
6148
  if (!layer) return;
6150
- const altitude = (options.altitude || 0) + (options.bottomHeight || 0) + this.#altitudeOffset;
6151
- const z = layer.altitudeToVector3(altitude, altitude).x;
6149
+ const altitude = options.altitude || 0;
6150
+ const bottomHeight = options.bottomHeight || 0;
6151
+ const totalHeight = altitude + bottomHeight + this.#altitudeOffset;
6152
+ const z = layer.altitudeToVector3(totalHeight, totalHeight).x;
6152
6153
  const position = layer.coordinateToVector3(this._coordinate, z);
6153
6154
  (0, import_lodash28.set)(this.properties, "default.position", position);
6154
6155
  this.getObject3d().position.copy(position);
@@ -6181,13 +6182,10 @@ var TextSpriteMarker = class extends import_maptalks9.BaseObject {
6181
6182
  group.add(newSprite);
6182
6183
  this._updatePosition();
6183
6184
  }
6184
- setAltitude(altitude) {
6185
- const bottomHeight = this.options.bottomHeight ?? 0;
6186
- return super.setAltitude(altitude + bottomHeight + this.#altitudeOffset);
6187
- }
6188
6185
  };
6189
6186
 
6190
6187
  // src/IndoorMap/renderer/3d/Marker3DRenderer.ts
6188
+ var MULTIORDINAL_HEIGHT_METER2 = 9;
6191
6189
  var Marker3DRenderer = class extends EventTarget {
6192
6190
  isReady = false;
6193
6191
  threeLayer;
@@ -6214,25 +6212,26 @@ var Marker3DRenderer = class extends EventTarget {
6214
6212
  map: new THREE3.TextureLoader().load(svgPath)
6215
6213
  });
6216
6214
  }
6217
- createTextMarker = (position, label, options) => {
6215
+ createTextMarker = (position, ordinal, label, options) => {
6218
6216
  const combinedOptions = {
6219
- altitude: 0,
6220
6217
  text: label,
6221
- ...options ?? {}
6218
+ ...options ?? {},
6219
+ altitude: ordinal * MULTIORDINAL_HEIGHT_METER2
6222
6220
  };
6223
6221
  const [lng, lat] = position;
6224
6222
  const marker = new TextSpriteMarker(new maptalks7.Coordinate(lng, lat), combinedOptions, this.threeLayer);
6225
6223
  this.threeLayer.addMesh([marker]);
6226
6224
  return marker;
6227
6225
  };
6228
- createImageMarker = (position, src, options) => {
6226
+ createImageMarker = (position, ordinal, src, options) => {
6229
6227
  const [lng, lat] = position;
6230
6228
  let meshes = [];
6231
6229
  const height = options.height ?? 0;
6232
6230
  const { leg, ...markerOptions } = options;
6233
6231
  const { color: legColor = "#000000", ...legOptions } = leg ?? {};
6234
6232
  const material = this.createPointMaterialFromSvg(src, 40);
6235
- const marker = this.threeLayer.toPoint(new maptalks7.Coordinate(lng, lat), { height, ...markerOptions }, material);
6233
+ const altitude = ordinal * MULTIORDINAL_HEIGHT_METER2;
6234
+ const marker = this.threeLayer.toPoint(new maptalks7.Coordinate(lng, lat), { height, altitude, ...markerOptions }, material);
6236
6235
  marker.getObject3d().renderOrder = 10;
6237
6236
  meshes.push(marker);
6238
6237
  if (options.leg) {
@@ -6676,7 +6675,7 @@ var RendererManager = class extends EventTarget {
6676
6675
  }
6677
6676
  };
6678
6677
  createMarker(type, coordinate, ordinal, textOrPath, options) {
6679
- const meshes = type === "text" ? this.markerRenderer.createTextMarker(coordinate, textOrPath, options) : this.markerRenderer.createImageMarker(coordinate, textOrPath, options);
6678
+ const meshes = type === "text" ? this.markerRenderer.createTextMarker(coordinate, ordinal, textOrPath, options) : this.markerRenderer.createImageMarker(coordinate, ordinal, textOrPath, options);
6680
6679
  const markerId = `${this.markersMap.size + 1}`;
6681
6680
  const markerMeshes = Array.isArray(meshes) ? (0, import_lodash29.compact)(meshes) : (0, import_lodash29.compact)([meshes]);
6682
6681
  this._addMarkersToManager(markerId, markerMeshes, ordinal);