Skip to content

Commit 0a1d7c7

Browse files
Update the _handleDrawGeometryTypeChange method with removing the creation of a new instance of vectorLayer and the addition of this layer to the map.
Add style to the draw interaction.
1 parent 4071ccd commit 0a1d7c7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

packages/base/src/mainview/mainView.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,21 +2052,17 @@ export class MainView extends React.Component<IProps, IStates> {
20522052
} else {
20532053
source = new VectorSource();
20542054
}
2055-
const vectorLayer = new VectorLayer({
2056-
source: source
2057-
/*style: {
2055+
const modify = new Modify({ source: source });
2056+
this._Map.addInteraction(modify);
2057+
const draw = new Draw({
2058+
source: source,
2059+
style: {
20582060
'fill-color': 'rgba(255, 255, 255, 0.2)',
20592061
'stroke-color': '#ffcc33',
20602062
'stroke-width': 2,
20612063
'circle-radius': 7,
20622064
'circle-fill-color': '#ffcc33'
2063-
}*/
2064-
});
2065-
this._Map.addLayer(vectorLayer);
2066-
const modify = new Modify({ source: source });
2067-
this._Map.addInteraction(modify);
2068-
const draw = new Draw({
2069-
source: source,
2065+
},
20702066
type: drawGeometryType as Type // Type being a geometry type here
20712067
});
20722068
const snap = new Snap({ source: source });

0 commit comments

Comments
 (0)