# Map Style Audit — Pre-Consolidation Reference

**Purpose:** Frozen pre-consolidation record of all style manager definitions across the five map-bearing JS files. Do not edit this document once consolidation begins — it is the reference if any style needs to be recovered.

**Files audited:**
- `www/js/map_v5.js`
- `www/js/project_edit_v2.js`
- `www/js/stocklist_edit.js`
- `www/js/opportunity_edit.js`
- `www/js/account_edit_v2.js`

**Audit date:** 2026-06-22

---

## 1. editstyles

An array of OL styles used for feature editing controls (vertex handles, geometry highlight during edit).

| File | Line | Notes |
|---|---|---|
| `map_v5.js` | 25–131 | Baseline; has `console.log` statements inside style functions |
| `project_edit_v2.js` | 1478–1585 | Identical to map_v5 **except** vertex style adds `zIndex: 9000` |
| `stocklist_edit.js` | 788 | Identical to map_v5 (no zIndex) |
| `opportunity_edit.js` | 873 | Identical to map_v5 (no zIndex) |
| `account_edit_v2.js` | 815 | Identical to map_v5 (no zIndex) |

**Consolidation recommendation:** Use `project_edit_v2.js` as the canonical version (`zIndex: 9000` prevents vertex handles being obscured by other layers). Remove `console.log` statements from the map_v5 copy.

---

## 2. polyStyleManager


> **Important:** `polyStyleManager` category names are **entirely different** across files. These are not the same manager — each file uses distinct categories serving different page-specific purposes. In `map_layer_utils.js`, all categories are combined into one manager; `getPolyStyle(layerCategory, type)` finds the right style regardless of which page calls it.

### 2.1 `map_v5.js` — `boundary_styles`


File location: lines 133–236

| Category | Type | Fill | Stroke color | Stroke width |
|---|---|---|---|---|
| `boundary_styles` | `blue` | rgba(0,0,255,0.08) | #0000ff | 2 |
| `boundary_styles` | `purple` | rgba(128,0,128,0.08) | #800080 | 2 |
| `boundary_styles` | `green` | rgba(0,128,0,0.08) | #008000 | 2 |
| `boundary_styles` | `red` | rgba(255,0,0,0.08) | #ff0000 | 2 |
| `boundary_styles` | `black` | rgba(0,0,0,0.08) | #000000 | 2 |
| `network` | stub | — | — | — |

Also has standalone poly/point style `const` variables (not in the manager — see Section 5).

### 2.2 `project_edit_v2.js` — `piaBlockageStyles` + `defaultStyles`

File location: lines 2861–2967

| Category | Type | Fill | Stroke color | Stroke style |
|---|---|---|---|---|
| `piaBlockageStyles` | `Blocked` | rgba(255,0,0,0.4) | #ff0000 | solid |
| `piaBlockageStyles` | `Cleared` | rgba(0,255,0,0.3) | #00ff00 | solid |
| `piaBlockageStyles` | `NoAccess` | rgba(255,165,0,0.4) | #ff8c00 | solid |
| `defaultStyles` | `grey` | rgba(128,128,128,0.2) | #808080 | dashed [5,5] |
| `defaultStyles` | `blue` | rgba(0,0,255,0.1) | #0000ff | dashed [5,5] |
| `network` | stub | — | — | — |

### 2.3 `stocklist_edit.js`

No `polyStyleManager` defined. Not needed — stocklist has no polygon layers requiring a poly style manager.

### 2.4 `opportunity_edit.js` — `opportunityPolyStyles`

File location: lines 982–1255

> Note: L0–L4 and Drop/Legacy types have the same colours as the corresponding `lineStyleManager.autoPlanNetworkStyles` types — these styles appear to be applied to both polygon and line geometry on the opportunity page.

| Category | Type | Fill | Stroke color | Stroke width | Stroke style | Notes |
|---|---|---|---|---|---|---|
| `opportunityPolyStyles` | `linked` | rgba(0,0,100,0) | rgb(0,130,0) | 2 | solid | transparent fill, green border |
| `opportunityPolyStyles` | `search` | rgba(0,0,100,0) | rgb(0,156,255) | 2 | solid | zIndex: 100 |
| `opportunityPolyStyles` | `nearby` | rgba(0,0,0,0.05) | rgb(177,177,177) | 2 | solid | zIndex: 99 |
| `opportunityPolyStyles` | `linked2` | #ff8800 | #ff8800 | 3 | solid | orange |
| `opportunityPolyStyles` | `Drop` | #003cff | #003cff | 1 | [10,5] | — |
| `opportunityPolyStyles` | `Legacy` | #000000 | #000000 | 1 | [5,5] | — |
| `opportunityPolyStyles` | `L0` | #002aff | #0032ff | 3 | [5,5] | text repeat:150 |
| `opportunityPolyStyles` | `L1` | #FF0000 | #FF0000 | 3 | [5,5] | text repeat:150 |
| `opportunityPolyStyles` | `L2` | #ff00ea | #ff00ea | 2 | [5,5] | text repeat:150 |
| `opportunityPolyStyles` | `L3` | #ff8800 | #ff8800 | 2 | [5,5] | text repeat:150 |
| `opportunityPolyStyles` | `L4` | #0000ff | #0000ff | 1 | [2,2] | text repeat:150 |
| `opportunityPolyStyles` | `Other` | rgba(0,150,0,0.15) | rgba(0,150,0,0.5) | 1 | [5,5] | — |
| `network` | stub | — | — | — | — | — |

### 2.5 `account_edit_v2.js`

No `polyStyleManager` defined. Not needed for the account page.

---

## 3. lineStyleManager

### 3.1 `autoPlanNetworkStyles` — type presence by file

| Type | map_v5 | project_edit | stocklist | opportunity | account |
|---|---|---|---|---|---|
| `Distribution` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `S1` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `S2` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `Drop` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `Legacy` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `L0` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `L1` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `L2` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `L3` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `L4` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `Other` | ✓ | ✓ | ✓ | ✓ | ✓ |
| `1W` | ✓ | ✓ | — | — | — |
| `2W` | ✓ | ✓ | — | — | — |
| `3W` | ✓ | ✓ | — | — | — |
| `4W` | ✓ | ✓ | — | — | — |
| `144F` | — | ✓ | — | — | — |
| `96F` | — | ✓ | — | — | — |
| `48F` | — | ✓ | — | — | — |
| `24F` | — | ✓ | — | — | — |
| `12F` | — | ✓ | — | — | — |
| `8F` | — | ✓ | — | — | — |
| `4F` | — | ✓ | — | — | — |
| `2F` | — | ✓ | — | — | — |
| `1F` | — | ✓ | — | — | — |
| `7mm:3.5mm` | — | ✓ | — | — | — |
| `12:8` | — | ✓ | — | — | — |
| `6W` | — | ✓ | — | — | — |
| `7W` | — | ✓ | — | — | — |
| `Oth` | — | ✓ | — | — | — |
| `network` | stub | stub | stub | stub | stub |

### 3.2 Core type colours — shared values (consistent across all files)

| Type | Stroke color | Width | Dash |
|---|---|---|---|
| `Distribution` | #FF0000 | 3 | [5,5] |
| `S1` | #ff00ea | 3 | [5,5] |
| `S2` | #ff8800 | 3 | solid |
| `Drop` | #003cff | 1 | [10,5] |
| `Legacy` | #000000 | 1 | [5,5] |

### 3.3 L-level type colours — consistent across files

| Type | Stroke color | Width | Dash |
|---|---|---|---|
| `L1` | #FF0000 | 3 | [5,5] |
| `L2` | #ff00ea | 2 | [5,5] |
| `L3` | #ff8800 | 2 | [5,5] |
| `L4` | #0000ff | 1 | [2,2] |

### 3.4 L0 rendering differences

L0 has a `placement: 'line'` text label that repeats along the line. The `repeat` value differs between files:

| File | L0 stroke color | L0 repeat |
|---|---|---|
| `map_v5.js` | #002aff | 150px |
| `project_edit_v2.js` | #0032ff | **250px** |
| `stocklist_edit.js` | #002aff | 150px |
| `opportunity_edit.js` | #002aff | 150px |
| `account_edit_v2.js` | #002aff | 150px |

> **Decision needed:** The shared manager can only have one `repeat` value. Use 150px (4 of 5 files) — project_edit will see denser labels, which is a minor visual change.

### 3.5 `opportunityLineStyles` — unique to `opportunity_edit.js`

Present in `opportunity_edit.js` only (in addition to `autoPlanNetworkStyles`). Exact types and colours to be documented from source lines 1558+ during consolidation phase.

---

## 4. pointStyleManager

### 4.1 `PlanEquipmentstyles` — type presence by file

| Type | map_v5 | project_edit | stocklist | opportunity | account | Shape |
|---|---|---|---|---|---|---|
| `MM` | ✓ | ✓ | — | ✓ | — | circle |
| `L0` | ✓ | ✓ | ✓ | ✓ | ✓ | triangle (3pt) |
| `L1` | — | — | ✓ | — | ✓ | square (4pt) |
| `L2` | — | — | ✓ | — | ✓ | pentagon (5pt) |
| `L3` | — | — | ✓ | — | ✓ | hexagon (6pt) |
| `L4` | — | — | ✓ | — | ✓ | octagon (8pt) |
| `DJ` | ✓ | ✓ | — | ✓ | — | — |
| `CMJ` | — | ✓ | — | — | — | — |
| `CMJ(1:4)` | — | ✓ | — | ✓ | — | — |
| `CMJ(1:8)` | — | ✓ | — | ✓ | — | — |
| `CMJ(1:4-1:8)` | — | ✓ | — | — | — | — |
| `FDN` | — | ✓ | — | ✓ | — | — |
| `PBO` | — | ✓ | — | ✓ | — | — |
| `1:32` | ✓ | ✓ | — | ✓ | — | — |
| `1:8` | ✓ | ✓ | — | ✓ | — | — |
| `1:4` | ✓ | ✓ | — | ✓ | — | octagon (8pt) |
| `Project` | — | — | ✓ | — | ✓ | 9pt star |
| `mdu_project` | — | — | ✓ | — | — | — |
| `smdu_project` | — | — | ✓ | — | — | — |
| `sdu_project` | — | — | ✓ | — | — | — |
| `Prem` | — | — | ✓ | — | ✓ | 9pt star |
| `mdu_prem` | — | — | ✓ | — | — | — |
| `smdu_prem` | — | — | ✓ | — | — | — |
| `sdu_prem` | — | — | ✓ | — | — | — |
| `Other` | ✓ | ✓ | ✓ (**×2!**) | ✓ | ✓ | — |
| `network` | stub | stub | stub | stub | stub | — |

> **Bug:** `stocklist_edit.js` defines `Other` twice in `PlanEquipmentstyles`. Second definition silently overrides the first. Fix when porting stocklist.

### 4.2 `PlanEquipmentstyles.MM` colour difference

This is the most significant colour conflict across files.

| File | MM fill | MM stroke |
|---|---|---|
| `map_v5.js` | **#3fff00** (bright green) | #1e9900 |
| `project_edit_v2.js` | **#b6b6b6** (grey) | #737373 |
| `stocklist_edit.js` | N/A | N/A |
| `opportunity_edit.js` | **#3fff00** (bright green) | #1e9900 |
| `account_edit_v2.js` | N/A | N/A |

> **Decision needed before consolidation:** Green vs grey for MM. These may be intentionally different (project editor shows MM in grey to distinguish from other equipment, while map/opportunity use green for visibility). Cannot be unified to a single style without a deliberate choice. Options: (a) keep two named variants `MM_green` / `MM_grey`; (b) accept one colour change; (c) handle as a page-scoped style override rather than a shared constant.

### 4.3 `PlanEquipmentstyles` L0–L4 colours (account/stocklist)

Account and stocklist both use L0–L4 with the same colour scheme (representing premises/equipment tier levels, not plan network hierarchy). These match the `lineStyleManager` L-level colours:

| Type | Fill / Stroke color | Shape |
|---|---|---|
| `L0` | #ff0101 | triangle (3pt) |
| `L1` | #ff6701 | square (4pt) |
| `L2` | #fe009d | pentagon (5pt) |
| `L3` | #9e01ff | hexagon (6pt) |
| `L4` | #0134ff | octagon (8pt) |

Note: In `map_v5.js` and `project_edit_v2.js`, `PlanEquipmentstyles.L0` uses the same red triangle — consistent.

### 4.4 `PlanStructurestyles` — type presence by file

| Type | map_v5 | project_edit | stocklist | opportunity | account | Shape / fill |
|---|---|---|---|---|---|---|
| `CAB` | ✓ | ✓ | — | ✓ | — | square (4pt, r=10), fill #1c6500 (dark green) |
| `JB` | — | ✓ | — | ✓ | — | square (4pt, r=8), fill #595959 (grey) |
| `SB` | ✓ | ✓ | — | ✓ | — | triangle (3pt, r=8), fill #734200 |
| `L1` | ✓ | ✓ | — | ✓ | — | square (4pt, r=7), fill #ff6701 |
| `L2` | ✓ | ✓ | — | ✓ | — | pentagon (5pt, r=7), fill #fe009d |
| `L3` | ✓ | ✓ | — | ✓ | — | hexagon (6pt, r=7), fill #9e01ff |
| `L4` | ✓ | ✓ | — | ✓ | — | octagon (8pt, r=7), fill #0123ff |
| `Other` | ✓ | ✓ | — | ✓ | — | rgba(0,150,0,0.15) fill |
| `network` | stub | stub | — | stub | — | — |

Colours are **consistent** across all files that define `PlanStructurestyles`. No conflicts.

> **Note:** `map_v5.js` does not have `JB` (junction box). `project_edit` and `opportunity` do. Safe to add `JB` to the shared manager — `map_v5` simply won't reference it.

---

## 5. Standalone styles (`map_v5.js` only)

Module-level `const` variables used directly in map_v5's layer style functions, not part of any manager.

| Variable | Used for | Fill | Stroke |
|---|---|---|---|
| `redPolyStyle` | Polygon | rgba(255,0,0,0.2) | #ff0000, width 2 |
| `bluePolyStyle` | Polygon | rgba(0,0,255,0.1) | #0000ff, width 2 |
| `greenPolyStyle` | Polygon | rgba(0,255,0,0.1) | #00ff00, width 2 |
| `greyPolyStyle` | Polygon | rgba(128,128,128,0.1) | #808080, width 2 |
| `nearbyPolyStyle` | Polygon | rgba(255,165,0,0.2) | #ff8c00, width 2 dashed |
| `pointStyleDefault` | Point fallback | circle, white fill | black stroke |

These should be added as named constants in `map_layer_utils.js` alongside the managers.

---

## 6. Consolidation decisions

`project_edit_v2.js` is the canonical source. Where any value differs between files, the `project_edit_v2.js` version is used unless noted otherwise below.

| # | Item | Decision |
|---|---|---|
| 1 | **MM fill colour** — green (#3fff00) in `map_v5`/`opportunity` vs grey (#b6b6b6) in `project_edit` | **grey (#b6b6b6)** — `project_edit_v2.js` is canonical |
| 2 | **L0 label repeat** — 150px in 4 files, 250px in `project_edit` | **250px** — `project_edit_v2.js` is canonical |
| 3 | **JB in PlanStructurestyles** — missing from `map_v5` | **Include** — safe to add; `map_v5` won't use it unless a JB layer is configured |
| 4 | **stocklist duplicate `Other` key** — last definition wins in current code | **Fix** during stocklist port |
| 5 | **polyStyleManager categories are page-specific** | **Combine** all categories into one shared manager; `getPolyStyle()` finds whichever category a layer uses |
| 6 | **opportunityLineStyles category** — unique to opportunity | **Include** in shared lineStyleManager; other pages won't use it |
| 7 | **Standalone map_v5 styles** (`redPolyStyle`, `bluePolyStyle`, etc.) | **Add as named exports** in utils alongside the managers |
| 8 | **editstyles `zIndex: 9000`** — present in `project_edit_v2.js` only | **Include** — `project_edit_v2.js` is canonical |
