venue-js 1.2.0-next.11 → 1.2.0-next.12

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.mjs CHANGED
@@ -3086,7 +3086,8 @@ var element3DRendererOptions = {
3086
3086
  default: { color: "#ffffff", height: 0.5 },
3087
3087
  byCategory: {
3088
3088
  water: { color: "#ACD7EC", height: 0.1 },
3089
- vegetation: { color: "#91C499", height: 0.5 }
3089
+ vegetation: { color: "#91C499", height: 0.5 },
3090
+ wall: { color: "#787878", topColor: "#ffffff", height: 4.2, width: 1 }
3090
3091
  }
3091
3092
  }
3092
3093
  };
@@ -3193,6 +3194,20 @@ var Element3DRenderer = class extends EventTarget {
3193
3194
  return [];
3194
3195
  }
3195
3196
  };
3197
+ const createLineString = (geometry, feature3) => {
3198
+ try {
3199
+ const color = feature3.properties.style.polygonFill ?? colorOptions ?? "#000000";
3200
+ const material = this.getOrCreateMaterialByColor(color);
3201
+ const extrudedLine = this.threeLayer.toExtrudeLine(
3202
+ new maptalks4.LineString(geometry.coordinates),
3203
+ { height: heightOptions, ...options },
3204
+ material
3205
+ );
3206
+ return [extrudedLine];
3207
+ } catch (err) {
3208
+ return [];
3209
+ }
3210
+ };
3196
3211
  try {
3197
3212
  switch (feature2.geometry.type) {
3198
3213
  case "MultiPolygon": {
@@ -3212,6 +3227,13 @@ var Element3DRenderer = class extends EventTarget {
3212
3227
  this.threeLayer.addMesh(meshes);
3213
3228
  return meshes;
3214
3229
  }
3230
+ case "LineString": {
3231
+ const { coordinates } = feature2.geometry;
3232
+ if (!coordinates) return [];
3233
+ const meshes = createLineString(feature2.geometry, feature2);
3234
+ this.threeLayer.addMesh(meshes);
3235
+ return meshes;
3236
+ }
3215
3237
  }
3216
3238
  } catch (err) {
3217
3239
  console.log(`error createGeometry`, err, { feature: feature2, options });
@@ -3274,7 +3296,8 @@ var Element3DRenderer = class extends EventTarget {
3274
3296
  return null;
3275
3297
  }
3276
3298
  switch (element.type) {
3277
- case "ExtrudePolygon": {
3299
+ case "ExtrudePolygon":
3300
+ case "ExtrudeLine": {
3278
3301
  const mesh = element.getObject3d();
3279
3302
  const originalMaterial = mesh.material;
3280
3303
  const highlightMaterial = this.getOrCreateMaterialByColor("#ff0000");