Skip to content

Network Mapper Background Design

Ed Mozley edited this page Nov 29, 2026 · 3 revisions

A background picture on a diagram page - design (discussion #434)

Status: built 29 November 2026 (#3256-#3257), not yet released. Code: assets/js/network-mapper-background.js (PDF page, shrinking) and assets/js/network-mapper.js (dialog, layer, Adjust); server: NetworkMapperService::replacePages(); test: tests/network-mapper-background.php. How it works underneath: Network Mapper Background - Developer Guide.

The request, from @Shadowtech87 on discussion #434:

"Would it be possible to add a background image to the network diagram? What I'm envisioning is having a floor map, perhaps a Visio image, and then as we put assets into the CMDB I can put them on their actual location throughout my sites."

They also asked for a read-only map for requesters, managers or HR, seat and room IDs, and a picture of a server rack with links to its nodes. Section 6 covers those.

In plain words

  • Each page of a diagram can have a background: a floor plan, a site map or a photo of a rack. You put icons and CMDB objects on top of it, where they really are.
  • It can come from a picture or a PDF. A picture already in My images, a new upload (PNG, JPEG, GIF or WebP), or one page of a PDF, which is turned into a picture in your browser. From Visio, save as PDF or PNG first (File → Save As); FreeITSM doesn't read .vsdx files.
  • It sits on its own locked layer at the bottom, so clicking on the plan never grabs it instead of the icon you meant.
  • Adjust background unlocks it to move, resize and fade it, then locks it again when you click Done.

1. What is there already

The Network Mapper already has most of the pieces, from the #433 work in 5.11.0:

Piece Already there
Your own pictures My images: upload or paste PNG, JPEG, GIF or WebP, up to 4 MB, checked by their contents
Moving and resizing Drag, and the handles on a picture's edges and corners
Fading Opacity in the Format panel
Keeping it out of the way Layers with show / hide and lock: nothing on a locked layer can be selected or moved
A plan per floor or site Pages, each with its own layers
Export PNG and PDF of the page you are on, with Save to Files

So a background can be done by hand today: add a layer, move it to the bottom, put the picture on it, lock the layer. This design makes that one step and handles the awkward parts: big files, PDFs, keeping its shape, and the layer staying at the bottom.

2. Set background

Layers → Set background, and Background... on the right-click menu of an empty part of the canvas. It opens a dialog with:

  • Upload a picture or a PDF: PNG, JPEG, GIF, WebP or PDF.
  • Or pick one of My images.

A PDF: the browser opens it with the PDF viewer the Files module already uses (pdf.js, shipped with FreeITSM), asks which page if there's more than one, and draws that page as a picture about 4,000 pixels across, sharp enough to zoom into a floor plan.

A big picture (more than 4,000 pixels across, or a large file) is made smaller in the browser and saved as WebP before it's uploaded, so it fits the upload limit even on a server left at PHP's 2 MB default. Floor plans are mostly lines and flat colour, so they stay sharp. It then goes into My images like any other picture, so it can be used again.

Where it goes:

  • The page gets a Background layer, always at the bottom and locked.
  • The picture is placed fitted to the paper (when a paper size is set) or to what's on the page, keeping its proportions.
  • Picking a new background for a page that already has one replaces the picture.

3. Adjust background

Layers → Adjust, or right-click → Adjust background:

  • The Background layer unlocks and the picture is selected, with a small bar over the canvas: Opacity, Fit, Original, Remove and Done.
  • Drag it to move it. Corner handles keep its proportions; hold Shift to stretch it.
  • Done (or Esc) locks the layer again.

Corners keep proportions for every picture, not only backgrounds: a stretched photo or logo is rarely what anyone wants, and it's what other drawing tools do. The side handles still stretch in one direction.

4. The Background layer

  • One per page, marked as the background (network_diagram_layers.is_background), so FreeITSM knows which layer to adjust without going by its name.
  • It stays at the bottom: its up and down arrows are off, and no other layer can move below it.
  • It can be hidden with the eye like any other layer, which is handy for checking icons without the plan behind them. Hidden layers are left out of Present mode and exports, as now.
  • New items never land on it, because it's locked.
  • It is copied with the page (Duplicate) and into a new version, like every layer.
  • The REST API reports and accepts it as is_background on a layer.

5. Decisions

Date Question Decided Why
29 Nov 2026 Use layers for this? Yes (Ed) A locked bottom layer is exactly what a background is; it's already built and understood.
29 Nov 2026 Controls to adjust it? Yes: move, resize keeping proportions, opacity, fit (Ed) A plan never arrives at the right size.
29 Nov 2026 Read Visio files? No: save as PDF or PNG from Visio Drawing a .vsdx faithfully is a project of its own; Visio's own export is two clicks and exact.
29 Nov 2026 Read-only view for requesters, managers, HR Use what exists for now (Ed): export, Save to Files, and a Knowledge article (section 6) Covers "where is seat 4B" today; a live read-only map is a bigger, separate piece.
29 Nov 2026 Big pictures Made smaller and saved as WebP in the browser, not a bigger server limit Works on every install, including PHP's 2 MB default.

6. The rest of the request

A read-only map for staff: export the page (PNG or PDF), Save to Files into a folder shared with the team that needs it (managers, HR). Saving again with the same name adds a new version, so the folder always has the current map.

A read-only map for requesters: Files shares with analysts and teams, not requesters, so put the map in a Knowledge article instead. Insert picture from Files (5.13.0) puts it in, and the article's audience decides who sees it in the self-service Help Centre. The picture goes in as a copy, so after the map changes, insert it again.

Both are snapshots: they don't update by themselves, and you can't click through to an asset. If people need a live map they can click, that's a later step, together with seat and room IDs as real records (linked to Locations and to assets) and move requests that point at a seat. Those are worth designing on their own once backgrounds are in use.

A photo of a server rack with links to its nodes works with this as it is: the photo is the background, and the CMDB objects go on top.

Not in this

  • Reading .vsdx, .dwg or other CAD files.
  • A scale ("1 cm = 1 m") or measuring on the plan.
  • More than one background picture on a page. A second picture can still go on any other layer.

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally