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.d.mts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +25 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ import { Map, Coordinate } from 'maptalks-gl';
|
|
|
8
8
|
import { BaseObject, ThreeLayer } from 'maptalks.three';
|
|
9
9
|
import * as maptalks from 'maptalks';
|
|
10
10
|
import { Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
|
|
11
|
-
import { BaseObjectOptionType, ExtrudePolygonOptionType } from 'maptalks.three/dist/type';
|
|
11
|
+
import { BaseObjectOptionType, ExtrudePolygonOptionType, ExtrudeLineOptionType } from 'maptalks.three/dist/type';
|
|
12
12
|
import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
|
|
13
13
|
import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
|
|
14
14
|
import { MapViewType, MapAnimationOptionsType, MapPaddingType } from 'maptalks/dist/map/Map';
|
|
@@ -810,12 +810,23 @@ type Element2DRendererOptions = {
|
|
|
810
810
|
fixture?: TypeRenderOptions<PolygonOptionsType>;
|
|
811
811
|
};
|
|
812
812
|
/** 3D */
|
|
813
|
+
type CreateExtrudeLineStringOptionType = ExtrudeLineOptionType & {
|
|
814
|
+
color?: string;
|
|
815
|
+
offset?: number;
|
|
816
|
+
};
|
|
813
817
|
type CreateExtrudePolygonOptionType = ExtrudePolygonOptionType & {
|
|
814
818
|
color?: string;
|
|
815
819
|
offset?: number;
|
|
816
820
|
};
|
|
817
821
|
type Element3DRendererOptions = {
|
|
818
|
-
fixture?:
|
|
822
|
+
fixture?: {
|
|
823
|
+
default: CreateExtrudePolygonOptionType;
|
|
824
|
+
byCategory: {
|
|
825
|
+
water: CreateExtrudePolygonOptionType;
|
|
826
|
+
vegetation: CreateExtrudePolygonOptionType;
|
|
827
|
+
wall: CreateExtrudeLineStringOptionType;
|
|
828
|
+
};
|
|
829
|
+
};
|
|
819
830
|
kiosk?: TypeRenderOptions<CreateExtrudePolygonOptionType>;
|
|
820
831
|
unit?: TypeRenderOptions<CreateExtrudePolygonOptionType>;
|
|
821
832
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { Map, Coordinate } from 'maptalks-gl';
|
|
|
8
8
|
import { BaseObject, ThreeLayer } from 'maptalks.three';
|
|
9
9
|
import * as maptalks from 'maptalks';
|
|
10
10
|
import { Extent, Marker, ui, LineString as LineString$1, Polygon as Polygon$1, MultiPolygon as MultiPolygon$1, MultiLineString } from 'maptalks';
|
|
11
|
-
import { BaseObjectOptionType, ExtrudePolygonOptionType } from 'maptalks.three/dist/type';
|
|
11
|
+
import { BaseObjectOptionType, ExtrudePolygonOptionType, ExtrudeLineOptionType } from 'maptalks.three/dist/type';
|
|
12
12
|
import { PolygonOptionsType } from 'maptalks/dist/geometry/Polygon';
|
|
13
13
|
import { LineStringOptionsType } from 'maptalks/dist/geometry/LineString';
|
|
14
14
|
import { MapViewType, MapAnimationOptionsType, MapPaddingType } from 'maptalks/dist/map/Map';
|
|
@@ -810,12 +810,23 @@ type Element2DRendererOptions = {
|
|
|
810
810
|
fixture?: TypeRenderOptions<PolygonOptionsType>;
|
|
811
811
|
};
|
|
812
812
|
/** 3D */
|
|
813
|
+
type CreateExtrudeLineStringOptionType = ExtrudeLineOptionType & {
|
|
814
|
+
color?: string;
|
|
815
|
+
offset?: number;
|
|
816
|
+
};
|
|
813
817
|
type CreateExtrudePolygonOptionType = ExtrudePolygonOptionType & {
|
|
814
818
|
color?: string;
|
|
815
819
|
offset?: number;
|
|
816
820
|
};
|
|
817
821
|
type Element3DRendererOptions = {
|
|
818
|
-
fixture?:
|
|
822
|
+
fixture?: {
|
|
823
|
+
default: CreateExtrudePolygonOptionType;
|
|
824
|
+
byCategory: {
|
|
825
|
+
water: CreateExtrudePolygonOptionType;
|
|
826
|
+
vegetation: CreateExtrudePolygonOptionType;
|
|
827
|
+
wall: CreateExtrudeLineStringOptionType;
|
|
828
|
+
};
|
|
829
|
+
};
|
|
819
830
|
kiosk?: TypeRenderOptions<CreateExtrudePolygonOptionType>;
|
|
820
831
|
unit?: TypeRenderOptions<CreateExtrudePolygonOptionType>;
|
|
821
832
|
};
|
package/dist/index.js
CHANGED
|
@@ -3135,7 +3135,8 @@ var element3DRendererOptions = {
|
|
|
3135
3135
|
default: { color: "#ffffff", height: 0.5 },
|
|
3136
3136
|
byCategory: {
|
|
3137
3137
|
water: { color: "#ACD7EC", height: 0.1 },
|
|
3138
|
-
vegetation: { color: "#91C499", height: 0.5 }
|
|
3138
|
+
vegetation: { color: "#91C499", height: 0.5 },
|
|
3139
|
+
wall: { color: "#787878", topColor: "#ffffff", height: 4.2, width: 1 }
|
|
3139
3140
|
}
|
|
3140
3141
|
}
|
|
3141
3142
|
};
|
|
@@ -3242,6 +3243,20 @@ var Element3DRenderer = class extends EventTarget {
|
|
|
3242
3243
|
return [];
|
|
3243
3244
|
}
|
|
3244
3245
|
};
|
|
3246
|
+
const createLineString = (geometry, feature3) => {
|
|
3247
|
+
try {
|
|
3248
|
+
const color = feature3.properties.style.polygonFill ?? colorOptions ?? "#000000";
|
|
3249
|
+
const material = this.getOrCreateMaterialByColor(color);
|
|
3250
|
+
const extrudedLine = this.threeLayer.toExtrudeLine(
|
|
3251
|
+
new maptalks4.LineString(geometry.coordinates),
|
|
3252
|
+
{ height: heightOptions, ...options },
|
|
3253
|
+
material
|
|
3254
|
+
);
|
|
3255
|
+
return [extrudedLine];
|
|
3256
|
+
} catch (err) {
|
|
3257
|
+
return [];
|
|
3258
|
+
}
|
|
3259
|
+
};
|
|
3245
3260
|
try {
|
|
3246
3261
|
switch (feature2.geometry.type) {
|
|
3247
3262
|
case "MultiPolygon": {
|
|
@@ -3261,6 +3276,13 @@ var Element3DRenderer = class extends EventTarget {
|
|
|
3261
3276
|
this.threeLayer.addMesh(meshes);
|
|
3262
3277
|
return meshes;
|
|
3263
3278
|
}
|
|
3279
|
+
case "LineString": {
|
|
3280
|
+
const { coordinates } = feature2.geometry;
|
|
3281
|
+
if (!coordinates) return [];
|
|
3282
|
+
const meshes = createLineString(feature2.geometry, feature2);
|
|
3283
|
+
this.threeLayer.addMesh(meshes);
|
|
3284
|
+
return meshes;
|
|
3285
|
+
}
|
|
3264
3286
|
}
|
|
3265
3287
|
} catch (err) {
|
|
3266
3288
|
console.log(`error createGeometry`, err, { feature: feature2, options });
|
|
@@ -3323,7 +3345,8 @@ var Element3DRenderer = class extends EventTarget {
|
|
|
3323
3345
|
return null;
|
|
3324
3346
|
}
|
|
3325
3347
|
switch (element.type) {
|
|
3326
|
-
case "ExtrudePolygon":
|
|
3348
|
+
case "ExtrudePolygon":
|
|
3349
|
+
case "ExtrudeLine": {
|
|
3327
3350
|
const mesh = element.getObject3d();
|
|
3328
3351
|
const originalMaterial = mesh.material;
|
|
3329
3352
|
const highlightMaterial = this.getOrCreateMaterialByColor("#ff0000");
|