| | |
| | | fetchAreaList(curZone).then((areas) => { |
| | | areas.forEach((area) => { |
| | | const { name, color, id } = area || {}; |
| | | const start = area?.start || (area?.startX != null ? { x: area.startX, y: area.startY } : null); |
| | | const end = area?.end || (area?.endX != null ? { x: area.endX, y: area.endY } : null); |
| | | if (!start || !end || !name) { |
| | | const start = area?.start; |
| | | const end = area?.end; |
| | | if (!start || !end || !name || !id) { |
| | | return; |
| | | } |
| | | const g = createAreaGraphic({ name, start, end, color, id }); |
| | | if (g) { |
| | | mapContainer.addChild(g); |
| | | const graphics = createAreaGraphic({ name, start, end, color, id }); |
| | | if (graphics) { |
| | | mapContainer.addChild(graphics); |
| | | } |
| | | }); |
| | | }); |