@arcgis/map-components
Version:
ArcGIS Map Components
105 lines (104 loc) • 2.19 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import t from "@arcgis/core/symbols/SimpleFillSymbol.js";
import i from "@arcgis/core/symbols/SimpleLineSymbol.js";
import n from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
import { getOrCreateMapValue as e } from "@arcgis/core/applications/Components/featureUtils.js";
const r = /* @__PURE__ */ new Map(), m = (o) => {
let l = null;
switch (o) {
case "polygon":
l = e(
r,
o,
() => new t({
color: [248, 248, 248, 0.4],
outline: new i({
cap: "round",
color: [0, 255, 0, 1],
join: "miter",
miterLimit: 1,
style: "solid",
width: 2
}),
style: "diagonal-cross"
})
);
break;
case "polyline":
l = e(
r,
o,
() => new i({
color: [0, 255, 0, 1],
width: 2
})
);
break;
case "point":
l = e(
r,
o,
() => new n({
style: "circle",
size: 6,
color: [0, 255, 0],
outline: { color: [0, 255, 0], width: 1 }
})
);
break;
default:
return null;
}
return l;
}, b = (o) => {
let l = null;
switch (o) {
case "polygon":
l = e(
r,
`hover-${o}`,
() => new t({
color: [248, 248, 248, 0.4],
outline: new i({
cap: "round",
color: [0, 255, 0, 1],
join: "miter",
miterLimit: 1,
style: "solid",
width: 2
}),
style: "none"
})
);
break;
case "polyline":
l = e(
r,
`hover-${o}`,
() => new i({
color: [0, 255, 255, 1],
width: 2
})
);
break;
case "point":
l = e(
r,
`hover-${o}`,
() => new n({
style: "circle",
size: 6,
color: [0, 255, 255],
outline: { color: [0, 255, 255], width: 1 }
})
);
break;
default:
return null;
}
return l;
};
export {
m as a,
b as g
};