Inspired by the Special:Nearby we want to add the option to display nearby articles in a Kartographer map at an article page.
Requirements (MVP)
- Implement behind a feature flag
- Add a button to dynamic maps, to show a “nearby” layer. Always disabled by default.
- Buttons should not have icons (including the existing "external maps" button).
- Display a map marker for other articles geolocated within the currently shown map area
- Style map markers to match Kartographer and show as separate from user-added markers T315861
- Use geosearch API as the source of articles (show only articles from current wiki)
- When marker is clicked, the standard pop-up appears with the article name shown as a linked title and the description has the short description (from wikidata) and the page preview image. It behaves like current marker pop-ups. Example:
- Show the most relevant (determined by CirrusSearch) articles T307208
- Determine maximum radius (and expand as far as possible). Uses longest diagonal from viewport so that the whole visible map will have results.
- Add auto-refresh: markers should refresh and reload most relevant on move and zoom. T315547
- Desktop only, do not add feature to mobile yet (hide on mobile) T315281
- Implement metrics for tracking usage, T315972 needs a subticket for show nearby specifically.
Out of scope
- Static maps
Open questions
- Find out as early as possible if the planned feature implementation requires a security and/or performance review. See T304076#8160891
- How do the other tools get their data? Check for caching mechanisms.
- Apps use geosearch, which is performant.
- Wikivoyage Nearby uses statically-produced files, not a pattern we want to follow.
- Data is locally cached on the client and merged with new query responses.
Next steps (post-MVP):
- Add pin grouping T308227
- Determine possibility for mobile support T326787
- Continue accessibility review and improve T308320
- Potentially: If needed, add refresh button to show new results after the user has moved within the map to change the bounding box. Possibly for mobile only. T327097
- Potentially: Improve styling of pop-up/article preview