Skip to content

Commit

Permalink
feat(SimpleMarkerSymbol): add outline styles in 2D
Browse files Browse the repository at this point in the history
Refs: #33
  • Loading branch information
sagewall committed Oct 23, 2023
1 parent 75b3e59 commit 671e38f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/components/SimpleLineSymbolForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
CalciteOption,
CalciteSelect
} from "@esri/calcite-components-react";
import React, { useState } from "react";
import React, { useEffect, useState } from "react";
import LineSymbolMarkerForm from "./LineSymbolMarkerForm";
import { CAP_OPTIONS, JOIN_OPTIONS, LINE_STYLE_OPTIONS } from "./lib/constants";
import { blockStyles, labelStyles } from "./lib/styles";
Expand Down Expand Up @@ -52,6 +52,13 @@ const SimpleLineSymbolForm = ({
let markerBlock;
let styleBlock;

useEffect(() => {
if (solidOnly) {
setStyle("solid");
handleStyleChange("solid");
}
}, [solidOnly]);

if (showMarker) {
markerBlock = (
<CalciteBlock
Expand Down
6 changes: 4 additions & 2 deletions src/components/SimpleMarkerSymbolForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface Props {
handleStyleChange: (value: InstanceType<typeof SimpleMarkerSymbol>["style"]) => void;
handleXoffsetChange: (value: string) => void;
handleYoffsetChange: (value: string) => void;
sceneView: boolean;
}

const SimpleMarkerSymbolForm = ({
Expand All @@ -44,7 +45,8 @@ const SimpleMarkerSymbolForm = ({
handleSizeChange,
handleStyleChange,
handleXoffsetChange,
handleYoffsetChange
handleYoffsetChange,
sceneView
}: Props) => {
const [angle, setAngle] = useState(0);
const [color, setColor] = useState("#007ac2");
Expand Down Expand Up @@ -94,7 +96,7 @@ const SimpleMarkerSymbolForm = ({
handleStyleChange={handleOutlineStyleChange}
handleWidthChange={handleOutlineWidthChange}
showMarker={false}
solidOnly={true}
solidOnly={sceneView}
/>
</CalciteBlock>
<CalciteLabel layout="default" style={labelStyles}>
Expand Down
1 change: 1 addition & 0 deletions src/components/SimpleMarkerSymbolShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const SimpleMarkerSymbolShell = () => {
handleStyleChange={handleStyleChange}
handleXoffsetChange={handleXoffsetChange}
handleYoffsetChange={handleYoffsetChange}
sceneView={sceneView}
/>
</div>
</CalcitePanel>
Expand Down

0 comments on commit 671e38f

Please sign in to comment.