Skip to content

Commit bf56f88

Browse files
fix: update import path for stylesheet and improve code formatting (#448)
1 parent 707c763 commit bf56f88

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

examples/editable-layers/widget/example.tsx

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import StaticMap from 'react-map-gl/maplibre';
2424
import type {FeatureCollection} from 'geojson';
2525

26-
import '@deck.gl/widgets/dist/stylesheet.css';
26+
import '@deck.gl/widgets/stylesheet.css';
2727

2828
export function getDefaultGeoJSON(): FeatureCollection {
2929
return {
@@ -83,7 +83,13 @@ const MODE_OPTIONS: EditModeTrayWidgetModeOption[] = [
8383
title: 'Draw rectangle',
8484
label: 'Rectangle'
8585
},
86-
{id: 'draw-circle', mode: DrawCircleFromCenterMode, icon: '◯', title: 'Draw circle', label: 'Circle'},
86+
{
87+
id: 'draw-circle',
88+
mode: DrawCircleFromCenterMode,
89+
icon: '◯',
90+
title: 'Draw circle',
91+
label: 'Circle'
92+
},
8793
{
8894
id: 'measure-distance',
8995
mode: MeasureDistanceMode,
@@ -155,7 +161,12 @@ function ControlPanel({modeConfig, onSetModeConfig, onClear, onReset}: ControlPa
155161
: null;
156162

157163
const buttons: {id: string; label: string; description: string; value: string | null}[] = [
158-
{id: 'none', label: 'Edit geometries', description: 'Use edit handles to modify shapes.', value: null},
164+
{
165+
id: 'none',
166+
label: 'Edit geometries',
167+
description: 'Use edit handles to modify shapes.',
168+
value: null
169+
},
159170
{
160171
id: 'difference',
161172
label: 'Subtract',
@@ -179,16 +190,20 @@ function ControlPanel({modeConfig, onSetModeConfig, onClear, onReset}: ControlPa
179190
return (
180191
<aside style={CONTROL_PANEL_STYLE}>
181192
<div>
182-
<h2 style={{margin: '0 0 4px', fontSize: '18px', fontWeight: 600}}>Editable layers editor</h2>
193+
<h2 style={{margin: '0 0 4px', fontSize: '18px', fontWeight: 600}}>
194+
Editable layers editor
195+
</h2>
183196
<p style={{margin: 0, fontSize: '14px', lineHeight: 1.5}}>
184-
Select a tool from the mode tray to draw new geometries, measure features, or adjust existing
185-
shapes in the scene.
197+
Select a tool from the mode tray to draw new geometries, measure features, or adjust
198+
existing shapes in the scene.
186199
</p>
187200
</div>
188201

189202
<section style={CONTROL_SECTION_STYLE}>
190203
<h3 style={{margin: 0, fontSize: '15px', fontWeight: 600}}>Boolean operations</h3>
191-
<p style={{margin: 0, fontSize: '13px', color: '#cbd5f5'}}>Apply when drawing overlapping polygons.</p>
204+
<p style={{margin: 0, fontSize: '13px', color: '#cbd5f5'}}>
205+
Apply when drawing overlapping polygons.
206+
</p>
192207
<div style={CONTROL_BUTTON_GROUP_STYLE}>
193208
{buttons.map((button) => {
194209
const active = button.value === booleanOperation;
@@ -220,16 +235,16 @@ function ControlPanel({modeConfig, onSetModeConfig, onClear, onReset}: ControlPa
220235
<section style={{...CONTROL_SECTION_STYLE, marginTop: '4px'}}>
221236
<h3 style={{margin: 0, fontSize: '15px', fontWeight: 600}}>Dataset</h3>
222237
<div style={CONTROL_BUTTON_GROUP_STYLE}>
223-
<button
224-
type="button"
225-
style={CONTROL_BUTTON_STYLE}
226-
onClick={onReset}
227-
>
238+
<button type="button" style={CONTROL_BUTTON_STYLE} onClick={onReset}>
228239
Reset example
229240
</button>
230241
<button
231242
type="button"
232-
style={{...CONTROL_BUTTON_STYLE, color: '#fecaca', borderColor: 'rgba(239, 68, 68, 0.7)'}}
243+
style={{
244+
...CONTROL_BUTTON_STYLE,
245+
color: '#fecaca',
246+
borderColor: 'rgba(239, 68, 68, 0.7)'
247+
}}
233248
onClick={onClear}
234249
>
235250
Clear features
@@ -301,7 +316,7 @@ export function Example() {
301316
mode,
302317
modeConfig,
303318
selectedFeatureIndexes,
304-
onEdit: ({ updatedData }) => {
319+
onEdit: ({updatedData}) => {
305320
setGeoJson(updatedData);
306321
}
307322
});

0 commit comments

Comments
 (0)