diff --git a/examples/index.ts b/examples/index.ts index f6d1831..9fa6614 100644 --- a/examples/index.ts +++ b/examples/index.ts @@ -103,7 +103,11 @@ buttonGroup.onclick = (evt) => { geometry = new CesiumPlot.FreehandLine(Cesium, viewer); break; case 'drawFreehandPolygon': - geometry = new CesiumPlot.FreehandPolygon(Cesium, viewer); + geometry = new CesiumPlot.FreehandPolygon(Cesium, viewer, { + material: Cesium.Color.GREEN, + outlineMaterial: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 1)'), + outlineWidth: 2, + }); break; case 'hide': geometry && geometry.hide(); @@ -115,6 +119,25 @@ buttonGroup.onclick = (evt) => { geometry && geometry.remove(); geometry = null; break; + case 'addEvent': + if (geometry) { + geometry.on('drawStart', () => { + console.error('start'); + }); + geometry.on('drawUpdate', (cartesian: Cesium.Cartesian3) => { + console.error('update', cartesian); + }); + geometry.on('drawEnd', (geometryPoints: any) => { + console.error('drawEnd', geometryPoints); + }); + geometry.on('editStart', () => { + console.error('editStart'); + }); + geometry.on('editEnd', (geometryPoints: any) => { + console.error('editEnd', geometryPoints); + }); + } + break; default: break; } diff --git a/index.html b/index.html index d6d0f7e..c27425d 100644 --- a/index.html +++ b/index.html @@ -24,7 +24,7 @@ justify-content: center; } - .button { + .button-container button { margin: 0 10px; padding: 6px 10px; background-color: #3498db; @@ -39,20 +39,21 @@
- - - - - - - - - - - - - - + + + + + + + + + + + + + + +