MCPcopy Create free account
hub / github.com/ecto/muni / MapDrawPolyline

Function MapDrawPolyline

depot/console/src/components/ui/map.tsx:1098–1132  ·  view source on GitHub ↗
({
    showLength = false,
    drawError = {
        color: "var(--color-destructive)",
    },
    shapeOptions = {
        color: "var(--color-primary)",
        opacity: 1,
        weight: 2,
    },
    ...props
}: DrawOptions.PolylineOptions)

Source from the content-addressed store, hash-verified

1096}
1097
1098function MapDrawPolyline({
1099 showLength = false,
1100 drawError = {
1101 color: "var(--color-destructive)",
1102 },
1103 shapeOptions = {
1104 color: "var(--color-primary)",
1105 opacity: 1,
1106 weight: 2,
1107 },
1108 ...props
1109}: DrawOptions.PolylineOptions) {
1110 const mapDrawHandleIcon = useMapDrawHandleIcon()
1111
1112 return (
1113 <MapDrawShapeButton
1114 drawMode="polyline"
1115 createDrawTool={(L, map) =>
1116 new L.Draw.Polyline(map, {
1117 ...(mapDrawHandleIcon
1118 ? {
1119 icon: mapDrawHandleIcon,
1120 touchIcon: mapDrawHandleIcon,
1121 }
1122 : {}),
1123 showLength,
1124 drawError,
1125 shapeOptions,
1126 ...props,
1127 })
1128 }>
1129 <WaypointsIcon />
1130 </MapDrawShapeButton>
1131 )
1132}
1133
1134function MapDrawCircle({
1135 showRadius = false,

Callers

nothing calls this directly

Calls 1

useMapDrawHandleIconFunction · 0.85

Tested by

no test coverage detected