{
- const allObj = drawObj
- .getAll()
- .features.filter(o => o.properties.id !== 'BUFFER');
-
- drawObj.changeMode('direct_select', {
- featureId: allObj[i].id
- });
- }}
- >
-
- {coord?.map((co, idx) => {
- if (idx % 2 === 0) {
- const fCoord = FormattingCoord(co);
- const current = fCoord.join(', ');
- if (idx !== coord.length - 1) {
- const next = FormattingCoord(coord[idx + 1]).join(
- ', '
- );
-
- return (
-
-
- {current}
- /
- {next}
-
-
- );
- } else {
- return (
-
-
- {current}
-
-
- );
- }
+ {viewCoordObj?.map((obj, i) => {
+ let coord =
+ obj.properties.id === 'LINE'
+ ? obj.geometry.coordinates
+ : obj.geometry.coordinates[0];
+ if (obj.properties.id === 'POLYGON') {
+ coord = coord.slice(0, coord.length - 1);
+ } else if (obj.properties.id === 'CIRCLE') {
+ coord = [obj.properties.center];
+ }
+
+ return (
+
{
+ const allObj = drawObj
+ .getAll()
+ .features.filter(o => o.properties.id !== 'BUFFER');
+
+ drawObj.changeMode('direct_select', {
+ featureId: allObj[i].id
+ });
+ }}
+ >
+
+
비행구역 {i + 1}
+
+ {coord?.map((co, idx) => {
+ if (idx % 2 === 0) {
+ const fCoord = FormattingCoord(co);
+ const current = fCoord.join(', ');
+ if (idx !== coord.length - 1) {
+ const next = FormattingCoord(coord[idx + 1]).join(
+ ', '
+ );
+
+ return (
+
+
+ {current}
+ /
+ {next}
+
+
+ );
} else {
- return null;
+ return (
+
+
+ {current}
+
+
+ );
}
- })}
-
+ } else {
+ return null;
+ }
+ })}
- );
- })}
-
- ) : null}
+