- 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 !
Card Locations
What it is
A card can have multiple locations, similar to how it can have multiple members: the places the work happens, such as a customer's office, a site or a venue. Each location has a name, an address and, when known, its latitude and longitude, with an Open in map link to the map service you choose. A map link pasted into the popup is read for its coordinates, so nobody has to type them.
Read more
- Wikipedia: Geographic coordinate system, World Geodetic System (WGS-84, the coordinates WeKan stores), Restrictions on geographic data in China (why Baidu and Amap coordinates are converted), Web mapping and OpenStreetMap.
- OpenStreetMap, the default map service.
- In WeKan: Cards, Migrating from Trello and Board Settings / Card.
How to use it
Location section on the card
The card detail shows a Location section (after Labels and Stickers) listing each location with its:
- name,
- address,
- and an Open in map link (when it has coordinates), to the map service chosen under Open map links at - OpenStreetMap unless you chose another.
Use the Add location button to add more, and the edit / remove buttons on each location to change or delete it. A single location imported from Trello keeps working and is shown in the same list.
Add a location:
- Open the card and click Add location (+) in the Location section.
- Fill in Location name, Address, Latitude and Longitude, or detect them from a map link (below).
- Click Save.
Edit or delete one: click the location's name or address to open the same popup, change it and click Save, or click Delete. The × beside a location removes it at once.
Detecting a location from a map link
The Add/Edit location popup can detect a location from any map link (Detect
location from any map link): Google Maps, Bing Maps, Apple Maps, Waze,
OpenStreetMap, HERE WeGo, Yandex Maps, Mapy.cz, 2GIS, Baidu Maps, Amap
(Gaode), generic ?q= / ?ll= / ?center= links, or a bare latitude, longitude pair:
- Paste the map link.
- Press Detect.
- The latitude, longitude and (when present) the place name/address are filled in automatically. Filled in the detected location details below. confirms it; Could not detect a location from this link. says nothing was found.
Choosing which map service to open
The popup has an Open map links at setting, saved to your user profile with its own Save button, that controls which map service the location "Open in map" links use. The same choice is used by Admin Panel / Problems / Offices:
- USA: Google Maps, Bing Maps, Apple Maps, Waze
- Europe: OpenStreetMap (default), HERE WeGo, Yandex Maps, Mapy.cz, 2GIS
- Asia: Baidu Maps, Amap (Gaode)
Showing it
Board sidebar (hamburger menu) → Board Settings → Card, row
Location: Show on Card draws the section (allowsLocation), Show on
Minicard draws each location's name (or address) on the minicard
(allowsLocationOnMinicard, off by default).
REST API
Locations are set through the card edit endpoint
(PUT /api/boards/:boardId/lists/:listId/cards/:cardId) with a locations array
of { name, address, latitude, longitude }:
python3 api.py setcardlocations BOARDID LISTID CARDID \
'[{"name":"HQ","address":"Helsinki","latitude":60.17,"longitude":24.94}]'
The array replaces the card's locations; an entry without an _id gets one,
and form-encoded coordinates are turned into numbers.
How the numbers are calculated
- Coordinates are stored as WGS-84 decimal degrees. A detected pair is accepted only when the latitude is within ±90 and the longitude within ±180; the first pattern that matches wins, the provider-specific ones first, because Yandex, Mapy.cz, 2GIS and Amap put the longitude first.
- Baidu Maps and Amap use offset datums: Baidu BD-09 and Amap GCJ-02. Inside mainland China (latitude 0.8293-55.8271, longitude 72.004-137.8347) a link's coordinates are converted to WGS-84 when detected, and back when the Open in map link is built (the "eviltransform" algorithm with the Krasovsky 1940 ellipsoid; the reverse is 10 fixed-point iterations to about 1e-9 degrees). Outside that box nothing is converted.
- Map zoom in the built links is 16 (OpenStreetMap, Bing, HERE, Yandex, Mapy.cz).
- A card has as many locations as you add; there is no limit of its own.
How it works in WeKan
- The card's
locationsarray of{ _id, name, address, latitude?, longitude? }in models/cards.js, withgetLocations,addLocation,updateLocationandremoveLocation. The legacy flatlocationName/locationAddress/locationLatitude/locationLongitudefields (a Trello import) are shown as one entry and moved intolocationson the first change (_migrateLegacyLocation). - The section and the
cardLocationsPopupare in client/components/cards/cardDetails.jade;parseMapLinkand the popup's events are in cardDetails.js. - models/lib/mapLink.js -
mapLinkForand theGCJdatum conversions; the chooser ismapProviderSelectin client/components/main/mapProvider.jade, saved by thesetMapProvidermethod in server/models/users.js toprofile.mapProvider, which accepts only the eleven providers. - REST: the
locationsbranch of the card edit endpoint in server/models/cards.js; the client command issetcardlocationsin api.py. - Tests: tests/cardLocationRemoval.test.cjs, tests/trelloImport.maplink.test.js and tests/tablePageMapPopup.test.cjs.
Related
Commits
- Location in Board Settings / Card can be shown on the minicard too
- Location has its own Board Settings / Card toggle
- The location remove button works again
- The map chooser moves to one place, shared with the Admin Panel
- Locations set through the REST API
- Detect a location from a map link of many providers, and choose the map service
- Several locations per card, and Trello's location imported