Inspired by the Special:Nearby we want to add the option to display nearby articles in a Kartographer map at an article page.
{F35010005}
##Requirements (MVP)
[x] Implement behind a feature flag
[x] Add a button to dynamic maps, to show a “nearby” layer. Always disabled by default.
[x] Buttons should not have icons (including the existing "external maps" button).
[x] Display a map marker for other articles geolocated within the currently shown map area
[x] Style map markers to match Kartographer and show as separate from user-added markers T315861
[x] Use geosearch API as the source of articles (show only articles from current wiki)
[x] 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: {F35010007}
[x] Show the most relevant (determined by CirrusSearch) articles T307208
[x] Determine maximum radius (and expand as far as possible). Uses longest diagonal from viewport so that the whole visible map will have results.
[x] Add auto-refresh: markers should refresh and reload most relevant on move and zoom. T315547
[x] 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
[x] Find out as early as possible if the planned feature implementation requires a [[ https://www.mediawiki.org/wiki/Security/SOP/Application_Security_Reviews | security ]] and/or [[ https://www.mediawiki.org/wiki/Wikimedia_Performance_Team/Performance_Review | performance ]] review. See T304076#8160891
[x] 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
##Related tools
[[ https://wikishootme.toolforge.org/#lat=52.478477&lng=13.4257276&zoom=15 | WikiShootMe ]], [[ https://wikinity.toolforge.org/ | Wikinity ]], [[ https://wikimap.toolforge.org/ | Wikimap ]], [[ https://www.geopedia.de/?m=0&lat=36.9741171&lon=-122.0307963&l=en&z=17&t=0 | Geopedia ]], [[ https://wiwosm.toolforge.org/osm-on-ol/kml-on-ol.php | WIWOSM ]] ([[ https://wiki.openstreetmap.org/wiki/WIWOSM | docs ]])
See also: https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2022/Miscellaneous/Show_nearby_or_related_articles_in_maps