Changes between Version 3 and Version 4 of Ticket #18542, comment 13


Ignore:
Timestamp:
2020-01-21T03:40:01+01:00 (2 months ago)
Author:
nyurik
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18542, comment 13

    v3 v4  
    33If the goal is to get the right value->URL formatter in tag2link, the easiest is to follow the same scheme as what iD does:
    441. convert key to a "sitelink":   `("Key:" + key).replace('_', ' ')` (replace underscores with spaces). See [https://github.com/openstreetmap/iD/blob/189a3f87e389f9c2745a9c25b98ec0e4823776dc/modules/services/osm_wikibase.js#L116 iD code].
    5 1. call `www.osm.org/w/api.php?action=wbgetentities&...` to get the data items for each of the sitelinks. You should pass all sitelinks to it in a single call, rather than calling it multiple times. See [https://github.com/openstreetmap/iD/blob/189a3f87e389f9c2745a9c25b98ec0e4823776dc/modules/services/osm_wikibase.js#L183 iD code].
     51. call `https://wiki.openstreetmap.org/w/api.php?action=wbgetentities&...` to get the data items for each of the sitelinks. You should pass all sitelinks to it in a single call, rather than calling it multiple times. See [https://github.com/openstreetmap/iD/blob/189a3f87e389f9c2745a9c25b98ec0e4823776dc/modules/services/osm_wikibase.js#L183 iD code].
    661. check if [https://wiki.openstreetmap.org/wiki/Property:P8 P8 property] claim is defined on each of the resulting data items, and if so, use it.
    77