auto: 2026-07-26 19:29 (ESD_LAPTOP)
This commit is contained in:
@@ -308,6 +308,7 @@ export function createSurfaceMapViewer(): SurfaceMapViewer {
|
||||
coordinates: unknown,
|
||||
width: number,
|
||||
height: number,
|
||||
marker: "dot" | "x" = "dot",
|
||||
): void {
|
||||
if (
|
||||
!Array.isArray(coordinates) ||
|
||||
@@ -317,6 +318,20 @@ export function createSurfaceMapViewer(): SurfaceMapViewer {
|
||||
return;
|
||||
}
|
||||
const [x, y] = toCanvasPoint(coordinates[0], coordinates[1], width, height);
|
||||
if (marker === "x") {
|
||||
// 표고점: 조금 굵고 큰 X 마커
|
||||
const arm = 4;
|
||||
const prevWidth = context.lineWidth;
|
||||
context.lineWidth = 2;
|
||||
context.beginPath();
|
||||
context.moveTo(x - arm, y - arm);
|
||||
context.lineTo(x + arm, y + arm);
|
||||
context.moveTo(x - arm, y + arm);
|
||||
context.lineTo(x + arm, y - arm);
|
||||
context.stroke();
|
||||
context.lineWidth = prevWidth;
|
||||
return;
|
||||
}
|
||||
context.beginPath();
|
||||
context.arc(x, y, 2, 0, Math.PI * 2);
|
||||
context.fillStyle = context.strokeStyle;
|
||||
@@ -374,13 +389,14 @@ export function createSurfaceMapViewer(): SurfaceMapViewer {
|
||||
geometry: GeoJsonGeometry,
|
||||
width: number,
|
||||
height: number,
|
||||
marker: "dot" | "x" = "dot",
|
||||
): void {
|
||||
const coordinates = geometry.coordinates;
|
||||
if (!Array.isArray(coordinates)) return;
|
||||
if (geometry.type === "Point") {
|
||||
drawPoint(context, coordinates, width, height);
|
||||
drawPoint(context, coordinates, width, height, marker);
|
||||
} else if (geometry.type === "MultiPoint") {
|
||||
coordinates.forEach((point) => drawPoint(context, point, width, height));
|
||||
coordinates.forEach((point) => drawPoint(context, point, width, height, marker));
|
||||
} else if (geometry.type === "LineString") {
|
||||
drawRing(context, coordinates, width, height, false);
|
||||
} else if (geometry.type === "MultiLineString") {
|
||||
@@ -429,8 +445,9 @@ export function createSurfaceMapViewer(): SurfaceMapViewer {
|
||||
if (!activeGisLayers.has(layer)) return;
|
||||
context.lineWidth = isContour(layer) ? 0.7 : 1.5;
|
||||
context.strokeStyle = GIS_LAYER_COLORS[layer];
|
||||
const marker = layer === "도엽_표고점" ? "x" : "dot";
|
||||
geoJsonLayers.get(layer)?.features?.forEach((feature) => {
|
||||
if (feature.geometry) drawGeometry(context, feature.geometry, width, height);
|
||||
if (feature.geometry) drawGeometry(context, feature.geometry, width, height, marker);
|
||||
});
|
||||
});
|
||||
if (showContourLabels) drawContourLabels(context, width, height);
|
||||
|
||||
Reference in New Issue
Block a user