Template:Highway system OSM map
For the template to work, the (P16) property must be set on the Wikidata entity linked to the article.
Usage
<syntaxhighlight lang="wikitext"> <mapframe height="200" text="Map" width="300">{ "type": "ExternalData", "service": "geoline", "properties": { "stroke-width": 3 }, "query": " SELECT ?id ?length (if(?id = wd:, '#C12838', '#07c63e') as ?stroke) (concat('Line length: ', str(?length), ' km') as ?description) (if(BOUND(?link), concat('', ?idLabel, ''), ?idLabel) as ?title) WHERE { {?id wdt:P16 wd:.} SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?id rdfs:label ?idLabel . } OPTIONAL {?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/>.} } GROUP BY ?id ?link ?idLabel ?length "}</mapframe> </syntaxhighlight>
Issues
Some highway systems will not display correctly if the length parameter is set, because some highway entries will have multiple values for the length property at Wikidata.