Difference between revisions of "Template:Italy Labelled Map"

From blackwiki
Jump to navigation Jump to search
imported>Begoon
(.)
imported>Jonesey95
(Fix JSON)
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#tag:mapframe|
+
<includeonly>{{#tag:mapframe|
 
{
 
{
 
   "type": "ExternalData",
 
   "type": "ExternalData",
Line 6: Line 6:
 
     "stroke-width": 1
 
     "stroke-width": 1
 
   },
 
   },
   "query": "
+
   "query": "SELECT ?id ?population ( '#C12838' as ?fill)  (concat('Population: ', str(?population)) as ?description) (concat('[[', substr(str(?link),31,500),  '{{!}}', ?stateLabel, ']]') as ?title) WHERE {   {?id wdt:P31 wd:Q1710033.}  union {?id wdt:P31 wd:Q16110. } OPTIONAL { ?id wdt:P1082 ?population. } SERVICE wikibase:label {   bd:serviceParam wikibase:language 'en' .   ?id rdfs:label ?stateLabel . } ?link schema:about ?id. ?link schema:isPartOf <https://en.wikipedia.org/> .} GROUP BY ?id ?link ?stateLabel ?population"
 
 
SELECT ?id ?population
 
  ( '#C12838' as ?fill)  
 
   (concat('Population: ', str(?population)) as ?description)
 
  (concat('[[', substr(str(?link),31,500),  '{{!}}', ?stateLabel, ']]') as ?title)
 
WHERE {
 
  {?id wdt:P31 wd:Q1710033.}  
 
   union
 
  {?id wdt:P31 wd:Q16110. }
 
  OPTIONAL { ?id wdt:P1082 ?population. }
 
  SERVICE wikibase:label {
 
    bd:serviceParam wikibase:language 'en' .
 
    ?id rdfs:label ?stateLabel .
 
  }
 
  ?link schema:about ?id.
 
  ?link schema:isPartOf <https://en.wikipedia.org/> .
 
} GROUP BY ?id ?link ?stateLabel ?population
 
 
 
"
 
 
}
 
}
 
|frameless  
 
|frameless  
Line 34: Line 15:
 
|width=300
 
|width=300
 
|height=350
 
|height=350
}}<noinclude>
+
}}</includeonly><noinclude>
===Alignment===
+
{{documentation}}
*You can align the map right, left or center with {{para|float|right}} {{para|float|left}} or {{para|float|center}}
+
==Templatedata==
*If you don't supply {{para|float}} the default is "right"
+
<templatedata>
 
+
{
 +
"params": {
 +
"float": {
 +
"label": "float",
 +
"description": "alignment (right, left, center)",
 +
"example": "right",
 +
"type": "string",
 +
"default": "right",
 +
"suggested": true
 +
}
 +
},
 +
"description": "Italy -  labelled map"
 +
}
 +
</templatedata>
  
 
[[Category:OpenStreetMap templates]]
 
[[Category:OpenStreetMap templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 16:11, 12 October 2019

Template documentation[view] [edit] [history] [purge]

<mapframe align="right" latitude="41.8" longitude="12.0" zoom="5" width="300" height="350"> {

 "type": "ExternalData",
 "service": "geoshape",
 "properties": {
   "stroke-width": 1
 },
 "query": "SELECT ?id ?population  ( '#C12838' as ?fill)   (concat('Population: ', str(?population)) as ?description)  (concat('', ?stateLabel, '') as ?title) WHERE {    {?id wdt:P31 wd:Q1710033.}   union  {?id wdt:P31 wd:Q16110. }  OPTIONAL { ?id wdt:P1082 ?population. }  SERVICE wikibase:label {    bd:serviceParam wikibase:language 'en' .    ?id rdfs:label ?stateLabel .  }  ?link schema:about ?id.  ?link schema:isPartOf <https://en.wikipedia.org/> .} GROUP BY ?id ?link ?stateLabel ?population"

} </mapframe>

Alignment

  • You can align the map right, left or center with |float=right |float=left or |float=center
  • If you don't supply |float= the default is "right"


See also

Templatedata

Italy - labelled map

Template parameters

ParameterDescriptionTypeStatus
floatfloat

alignment (right, left, center)

Default
right
Example
right
Stringsuggested