Användare:Ainali/Mapframe
Utseende
Help:Extension:Kartographer, Ikoner
Bara koordinat
[redigera | redigera wikitext]<mapframe zoom="13" longitude="-122.3995" latitude="37.8103" width="350" height="350" />
Kartpolygon från OpenStreetMap
[redigera | redigera wikitext]<mapframe text="Dalarnas län" width="350" height="350" >
{
"type": "ExternalData",
"service": "geoshape",
"ids": "Q103732"
}
</mapframe>
Karta med markörer
[redigera | redigera wikitext]<mapframe text="Flera grupper med automatisk räkning" width="350" height="350" zoom="13" longitude="-122.39902496337889" latitude="37.80151060070086">
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.41816520690917,
37.79097260220947
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40786552429199,
37.799654055191525
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40185737609865,
37.796262984039544
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.38743782043457,
37.80535070427755
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number",
"marker-color": "302060"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.38005638122557,
37.795449103799726
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-letter",
"marker-color": "208020"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40941047668457,
37.81850557172186
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-letter",
"marker-color": "208020"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.40357398986815,
37.81280993744834
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-letter",
"marker-color": "208020"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.39842414855956,
37.8071138637568
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number-bar",
"marker-color": "f01080"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.41181373596191,
37.78595317184089
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number-bar",
"marker-color": "f01080"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.39542007446289,
37.787674400057654
]
}
},
{
"type": "Feature",
"properties": {
"marker-symbol": "-number-bar",
"marker-color": "f01080"
},
"geometry": {
"type": "Point",
"coordinates": [
-122.38649368286131,
37.78401144262929
]
}
}
]
}
</mapframe>
Fråga mot Wikidata som hämtar kartpolygoner från OpenStreetMap
[redigera | redigera wikitext]USA
[redigera | redigera wikitext]<mapframe latitude="52" longitude="-110" zoom="3" width="500" height="500" text="Guvernörer i USAs delstater med partitillhörighet">
{
"type":"ExternalData",
"service": "geoshape",
"query": "SELECT ?id ?head (SAMPLE(?img) as ?img_) (min(?partyId) as ?party) (if(?party = '0', '#800000', if(?party = '1', '#000080', '#008000')) as ?fill) (concat('[[:en:', substr(str(?link),31,500), '{{!}}', ?headLabel, ']]') as ?title) (concat(?stateLabel, '\\n', '[[File:', substr(str(?img_), 52, 500), '{{!}}200px]]') as ?description) WHERE { ?id wdt:P31 wd:Q35657 . ?id wdt:P6 ?head . ?head wdt:P102 ?party . BIND(if(?party = wd:Q29468, '0', if(?party = wd:Q29552, '1', '2')) as ?partyId) SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' . ?head rdfs:label ?headLabel . ?id rdfs:label ?stateLabel . } OPTIONAL { ?head wdt:P18 ?img . } ?link schema:about ?head . ?link schema:isPartOf <https://en.wikipedia.org/> .} GROUP BY ?id ?head ?headLabel ?link ?stateLabel"
}
</mapframe>
Sverige
[redigera | redigera wikitext]Världsarv
[redigera | redigera wikitext]<mapframe latitude="63" longitude="16" zoom="4" width="250" height="400" text="Världsarv i Sverige (klicka på en punkt för att visa namn och bild).">
{
"type": "ExternalData",
"service": "geopoint",
"query": "SELECT ?id ?title ?description ?geo ?image ?marker_color ?marker_symbol WHERE { ?id wdt:P1435 wd:Q9259; wdt:P17 wd:Q34 ; wdt:P625 ?geo; wdt:P18 ?image . MINUS { ?id wdt:P361 [] } BIND('#991111' AS ?marker_color) BIND('museum' AS ?marker_symbol) BIND(IF(BOUND(?image),CONCAT('[[File:',REPLACE(STR(?image),'http://commons.wikimedia.org/wiki/Special:FilePath/',''),'{{!}}200px]]'),'') AS ?description) ?link schema:about ?id . ?link schema:isPartOf <https://sv.wikipedia.org/> BIND(CONCAT('[[:sv:', REPLACE(STR(?link),'http://commons.wikimedia.org/wiki/',''), '{{!}}', ?head, ']]') as ?title) SERVICE wikibase:label { bd:serviceParam wikibase:language 'sv'. ?id rdfs:label ?head } }"
}
</mapframe>
Politik
[redigera | redigera wikitext]<mapframe latitude="63" longitude="16" zoom="4" width="250" height="400" text="Landshövdingar i Sveriges län med partitillhörighet på en karta (klicka på ett län för att visa namn och foto).">
{
"type": "ExternalData",
"service": "geoshape",
"query": "SELECT ?id ?head (SAMPLE(?img) as ?img_) (SAMPLE(?fill) as ?fill) (concat('[[', substr(str(?link),31,500), '{{!}}', ?headLabel, ']]') as ?title) (concat(?stateLabel, '\\n', '[[File:', substr(str(?img_), 52, 500), '{{!}}200px]]') as ?description) WHERE { ?id wdt:P31 wd:Q200547 . ?id wdt:P6 ?head . OPTIONAL { ?head wdt:P102 ?party . ?party wdt:P465 ?f. } BIND(IF(BOUND(?f),?f,'DDDDDD') AS ?f) BIND((concat('#',?f)) as ?fill) SERVICE wikibase:label { bd:serviceParam wikibase:language 'sv' . ?head rdfs:label ?headLabel . ?id rdfs:label ?stateLabel . } OPTIONAL { ?head wdt:P18 ?img . } OPTIONAL { ?link1 schema:about ?head ; schema:isPartOf <https://sv.wikipedia.org/> . } ?link2 schema:about ?id ; schema:isPartOf <https://sv.wikipedia.org/> . BIND(IF(BOUND(?link1),?link1,?link2) AS ?link) } GROUP BY ?id ?head ?headLabel ?link ?stateLabel"}
</mapframe>