iTowns / itowns

A Three.js-based framework written in Javascript/WebGL for visualizing 3D geospatial data
http://www.itowns-project.org
Other
1.06k stars 290 forks source link

[Proposal] Make our styling API evolve towards 3D styling #2336

Open jailln opened 3 weeks ago

jailln commented 3 weeks ago

Context

Proposal

My proposition is to harmonize style declaration for 2D and 3D layers in our API and therefore extend the Style class to support 3D styling options.

Example

Current point style declaration for C3DTilesLayer:

            var $3dTilesLayerSetePC = new itowns.ThreeDTilesLayer('3d-tiles-sete', {
                name: 'SetePC',
                pntsMode: itowns.PNTS_MODE.CLASSIFICATION,
                pntsShape : itowns.PNTS_SHAPE.CIRCLE,
                source: $3dTilesSource,
            });

New point style declaration for C3DTilesLayer:

            var $3dTilesLayerSetePC = new itowns.ThreeDTilesLayer('3d-tiles-sete', {
                name: 'SetePC',
                style: {
                    point: {
                         color: itowns.PNTS_MODE.CLASSIFICATION,
                         shape: itowns.PNTS_SHAPE.CIRCLE
                    }
                }
                source: $3dTilesSource,
            });

Related topics and open questions

Let me know what you think, if we go along with this I can start implementing it for the new ThreeDTilesLayer using 3d-tiles-renderer-js