mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 17:45:18 -05:00
- The General/ level is gone: its 109 files moved up into the folders of the same name, and its topic table is the "Shared topics" section of Features.md. - Accessibility is one folder, docs/Features/Accessibility/, with the Admin Panel's accessibility page in it. - Every folder's main page is README.md (110 X/X.md pages renamed with git mv, five merged with an existing README.md, 26 index pages added for folders that had none), so a folder opened on GitHub shows its page. - The 73 "# Moved" forwarding pages are deleted, with the folders that held only them; every link that went to one goes to its final page. - docs/Features/README.md has the website's "Features in WeKan" overview, each feature linking to its page here. 1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose, snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when General/ or a "# Moved" page comes back, a folder has no README.md, or a relative link in the docs or README.md does not resolve. Thanks to xet7 !
4.9 KiB
4.9 KiB
Map view
What it is
The Map view (#3256) shows the board's cards as markers on an image the board admin uploads - a floor plan, a site map or a drawing. It is for work that happens in places: rooms of a building, machines on a factory floor, plots of a site. Each card is put where it belongs on the image, and clicking a marker opens the card.
Read more
- Floor plan at Wikipedia - the kind of image the view is made for.
- Image map at Wikipedia - clickable places on an image, which is what the markers are.
- WeKan: Board Settings → Board View, Admin Panel → Settings → Features, Attachments.
How to use it
Open it. Board header → Board View → Map (in the menu's Board group). A site admin can turn it off with "Map view" in Admin Panel → Settings → Features.
The map image. Until there is one, the view says so: "This board has no map image yet."
- As a board admin, open the Map view.
- Click Upload a map image and choose a PNG, JPEG, GIF or WebP file.
- To take it off again, click Remove the map image; the cards keep their places for the next image.
Every member of the board can see the image, assigned-only members included. A failed upload shows a translated error under the button.
Cards on the map.
- A marker has the colour of the card's first label, the card number when the board numbers its cards, and the title as its tooltip. Click it to open the card.
- Those who may change the board see Not on the map: the cards without a place. Drag one onto the map, or choose it and click where it belongs. Drag a marker to move it. When every card has a place the list says "Every card is on the map."
How the numbers are calculated
From models/lib/boardMap.js:
- A place is stored on the card as a percentage of the image's width and height
(
mapX,mapY), so it stays right when the image is shown at another size. - Percent from a click or drop =
(pointer x - image left) / image width × 100, and the same for y with top and height. - Clamping and rounding: every coordinate is clamped to 0-100 and rounded
to two decimals. A value that is not a number (or is empty) means "not
placed";
nullis not taken as 0, so an unplaced card is never put in the top-left corner. - Placed = both
mapXandmapYare valid. Placing with an invalid coordinate removes the place instead. - The marker text is the card number (when the board numbers cards), otherwise empty; the colour is the first of the card's labels that still exists on the board.
- Which cards: the board's cards that are not archived and not template cards, in their board order.
How it works in WeKan
- View:
client/components/boards/mapView.jade,
.js and
.css. The view is marked
nodragscroll, so the board's drag-to-scroll does not cancel a drag onto the map. - Pure module: models/lib/boardMap.js
(
clampPercent,percentFromPoint,isPlaced,mapMarker), with no Meteor code. - Data: the image is a board-level attachment (
meta.sourceboard-map), uploaded the way board backgrounds are; its id is the board'smapImageAttachmentId, set and removed withsetMapImage()in models/boards.js. A card's place is written withsetMapPosition()and removed withclearMapPosition()in models/cards.js. - Permissions: the upload and remove buttons are shown to board admins;
Not on the map, dragging and placing are offered when
Utils.canModifyBoard()allows it, and the writes go through the board's and card's own update rules like any other change. - Menu and feature switch:
board-view-mapin models/lib/boardViewSettings.js, featureviews-mapin models/lib/instanceFeatures.js. - Tests: tests/boardMap.test.cjs, tests/playwright/specs/map-view.e2e.js.