Skip to content

Commit 29935fa

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 5d8651f commit 29935fa

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
@@ -2051,21 +2051,17 @@ export class MainView extends React.Component<IProps, IStates> {
20512051
} else {
20522052
source = new VectorSource();
20532053
}
2054-
const vectorLayer = new VectorLayer({
2055-
source: source
2056-
/*style: {
2054+
const modify = new Modify({ source: source });
2055+
this._Map.addInteraction(modify);
2056+
const draw = new Draw({
2057+
source: source,
2058+
style: {
20572059
'fill-color': 'rgba(255, 255, 255, 0.2)',
20582060
'stroke-color': '#ffcc33',
20592061
'stroke-width': 2,
20602062
'circle-radius': 7,
20612063
'circle-fill-color': '#ffcc33'
2062-
}*/
2063-
});
2064-
this._Map.addLayer(vectorLayer);
2065-
const modify = new Modify({ source: source });
2066-
this._Map.addInteraction(modify);
2067-
const draw = new Draw({
2068-
source: source,
2064+
},
20692065
type: drawGeometryType as Type // Type being a geometry type here
20702066
});
20712067
const snap = new Snap({ source: source });

0 commit comments

Comments
 (0)