Mal:Map draw

Fra Wikisida.no
Hopp til navigering Hopp til søk
Maldokumentasjon

Formål

[rediger kilde]

Mal for å tegne objekter på et kart med interessepunkter, linjer eller polygoner. Ved å klikke på det utvides det dynamiske kartet til fullskjerm, og man får informasjon om hvert av objektene.

Denne malen er et hjelpemiddel for å bygge geoJSON-syntaksen til Kartographer-utvidelsen med en fleksibel parameterstruktur. Noen verdier kan beregnes automatisk eller hentes fra Wikidata.

Parametre

[rediger kilde]
{{map draw
    |type= |latitude= |longitude=  |zoom= 
    |height= |width= |text= |align= |frameless= |class= |item=
    |coordinates= |title= |description= |image= 
    |marker-color= |marker-size= |marker-symbol=
    |stroke= |stroke-width= |stroke-opacity=
    |fill= |fill-opacity=
    |geotype= |ids=
        |geotype1=Point |coordinates1/ids1= |marker-color1= |marker-size1= |marker-symbol1= |title1/description1/image1= 
        |geotype2=LineString |coordinates2/ids2= |stroke2= |stroke-width2= |stroke-opacity2= |title2/description2/image2= 
        |geotype3=Polygon |coordinates3/ids3= |fill3= |fill-opacity3= |stroke3= |stroke-width3= |stroke-opacity3= |title3/description3/image3= 
        |geotype4=circle |radius4/radiuskm4 = |coordinates4/ids4= |edges4 |turn= |fill4= |fill-opacity4= |stroke4= |stroke-width4= |stroke-opacity4= |title4/description4/image4= 
        |geotype5=geoshape/geomask/geoline |ids5= |fill5= |fill-opacity5= |stroke5= |stroke-width5= |stroke-opacity5= |title5= |description5= |image5= 
        |geotype6=page |commons6= 
        |geotype7=named |from7= 
        |...
}}

marker-symbol: se denne siden for ulike kartmarkører.

Eksempler

[rediger kilde]

Et punkt

{{map draw | 78.2139, 15.8698}}

<mapframe align="right" height="300" latitude="78.2139" longitude="15.8698" width="300" zoom="9">[{"features":[{"type":"Feature","geometry":{"coordinates":[15.8698,78.2139],"type":"Point"},"properties":{"title":"Point1"}}],"type":"FeatureCollection"}]</mapframe>

Med lenkeformat

{{map draw | 78.2139, 15.8698 | type=maplink}}
{{map draw | 78.2139, 15.8698 | type=maplink | text=OpenStreetMap}}

<maplink latitude="78.2139" longitude="15.8698">[{"features":[{"type":"Feature","geometry":{"coordinates":[15.8698,78.2139],"type":"Point"},"properties":{"title":"Point1"}}],"type":"FeatureCollection"}]</maplink>

<maplink text="OpenStreetMap">[{"features":[{"type":"Feature","geometry":{"coordinates":[15.8698,78.2139],"type":"Point"},"properties":{"title":"Point1"}}],"type":"FeatureCollection"}]</maplink>

Flere punkter

{{map draw
| marker-symbol=-number
| title1=Det kongelige slott | coordinates1=59.917148,10.727479
| title2=Stortinget | coordinates2=59.913,10.740021
| title3=Oslo domkirke | coordinates3=59.912537,10.747062
}}

<mapframe align="right" height="300" latitude="59.9148425" longitude="10.7372705" width="300" zoom="13">[{"features":[{"type":"Feature","geometry":{"coordinates":[10.727479,59.917148],"type":"Point"},"properties":{"title":"Det kongelige slott","marker-symbol":"-number"}},{"type":"Feature","geometry":{"coordinates":[10.740021,59.913],"type":"Point"},"properties":{"title":"Stortinget","marker-symbol":"-number"}},{"type":"Feature","geometry":{"coordinates":[10.747062,59.912537],"type":"Point"},"properties":{"title":"Oslo domkirke","marker-symbol":"-number"}}],"type":"FeatureCollection"}]</mapframe>

En linje

{{map draw | 38.08922, -0.94195; 38.11109, -0.90405; 38.12167, -0.87755; 38.13886, -0.88745; 38.15288, -0.89089; 38.16561, -0.87381; 38.17467, -0.87917; 38.18072, -0.8698; 38.16861, -0.83775; 38.20428, -0.81725; 38.22083, -0.78589; 38.23519, -0.78819; 38.25106, -0.75581; 38.25778, -0.713; 38.26961, -0.70614; 38.28647, -0.66525; 38.32603, -0.65289; 38.34356, -0.61256; 38.35792, -0.55347; 38.35375, -0.53117
| zoom=10
| height=420 | width=420 
}}

<mapframe align="right" height="420" latitude="38.22357" longitude="-0.73656" width="420" zoom="10">[{"features":[{"type":"Feature","geometry":{"coordinates":[[-0.94195,38.08922],[-0.90405,38.11109],[-0.87755,38.12167],[-0.88745,38.13886],[-0.89089,38.15288],[-0.87381,38.16561],[-0.87917,38.17467],[-0.8698,38.18072],[-0.83775,38.16861],[-0.81725,38.20428],[-0.78589,38.22083],[-0.78819,38.23519],[-0.75581,38.25106],[-0.713,38.25778],[-0.70614,38.26961],[-0.66525,38.28647],[-0.65289,38.32603],[-0.61256,38.34356],[-0.55347,38.35792],[-0.53117,38.35375]],"type":"LineString"},"properties":{"title":"LineString1"}}],"type":"FeatureCollection"}]</mapframe>

En polygon

{{map draw
 | 18.45, -66.066667; 25.775278, -80.208889; 32.333333, -64.75; 18.45, -66.066667
 | fill=#1E90FF
 | text = [[Bermudatriangelet]]
}}

<mapframe align="right" height="300" latitude="25.3916665" longitude="-72.4794445" text="Bermudatriangelet" width="300" zoom="4">[{"features":[{"type":"Feature","geometry":{"coordinates":[[[-66.066667,18.45],[-80.208889,25.775278],[-64.75,32.333333],[-66.066667,18.45]]],"type":"Polygon"},"properties":{"title":"Polygon1","fill":"#1E90FF"}}],"type":"FeatureCollection"}]</mapframe>

En sirkel

{{map draw
 | geotype1 = circle
 | radius1 = 45000
 | ids1 = Q1049092
 | fill-opacity1 = 0.2
 | text = Tsunamien ved Sumatra i 2010
}}

Lua-feil i mw.text.lua, linje 246: bad argument #1 to 'len' (string expected, got nil).

Kombinasjon av ulike objekter

{{map draw
 | zoom = 14
 | align = center
 | text = Gamlebyen i València ved siden av Túriahagene (grønt). Katedralen og rådhuset markert.
 | marker-size = small | marker-color = #4682B4
 | title1 = Catedral de València
   | image1 = Porta ferros.jpg
   | marker-symbol1 = religious-christian 
   | coordinates1 = 39.475833, -0.375
 | title2 = Ajuntament de València
   | description2 = Plaça de l'Ajuntament
   | marker-symbol2 = town-hall
   | coordinates2 = 39.469836, -0.376989
 | title3 = Jardí del Túria
   | image3 = Jardines del Turia - 5. January 2006 -1.jpg
   | stroke3 = #00FA9A | stroke-width3 = 20 | stroke-opacity = 0.6
   | coordinates3 = 39.475830, -0.396043; 39.482210, -0.380346; 39.480546, -0.375389; 39.476483, -0.368754; 39.469836, -0.363182; 39.464092, -0.359831
 | title4 = Districte de Ciutat Vella
   | fill4 = #F5DEB3 | fill-opacity4 = 0.4
   | coordinates4 = 39.480517, -0.382817; 39.481246, -0.380532; 39.480890, -0.378504; 39.477445, -0.371702; 39.472737, -0.366780; 39.472074, -0.368486; 39.469714, -0.371147; 39.467105, -0.374988; 39.468422, -0.380578; 39.470377, -0.383507; 39.471917, -0.384054; 39.475742, -0.384120; 39.478308, -0.383739; 39.480517, -0.382817
}}

<mapframe align="center" height="300" latitude="39.473151" longitude="-0.377937" text="Gamlebyen i València ved siden av Túriahagene (grønt). Katedralen og rådhuset markert." width="300" zoom="14">[{"features":[{"type":"Feature","geometry":{"coordinates":[-0.375,39.475833],"type":"Point"},"properties":{"marker-size":"small","title":"Catedral de València","marker-color":"#4682B4","stroke-opacity":0.6,"marker-symbol":"religious-christian","description":""}},{"type":"Feature","geometry":{"coordinates":[-0.376989,39.469836],"type":"Point"},"properties":{"marker-size":"small","title":"Ajuntament de València","marker-color":"#4682B4","stroke-opacity":0.6,"marker-symbol":"town-hall","description":"Plaça de l'Ajuntament"}},{"type":"Feature","geometry":{"coordinates":[[-0.396043,39.47583],[-0.380346,39.48221],[-0.375389,39.480546],[-0.368754,39.476483],[-0.363182,39.469836],[-0.359831,39.464092]],"type":"LineString"},"properties":{"marker-size":"small","description":"","marker-color":"#4682B4","stroke-width":20,"stroke":"#00FA9A","title":"Jardí del Túria","stroke-opacity":0.6}},{"type":"Feature","geometry":{"coordinates":[[[-0.382817,39.480517],[-0.380532,39.481246],[-0.378504,39.48089],[-0.371702,39.477445],[-0.36678,39.472737],[-0.368486,39.472074],[-0.371147,39.469714],[-0.374988,39.467105],[-0.380578,39.468422],[-0.383507,39.470377],[-0.384054,39.471917],[-0.38412,39.475742],[-0.383739,39.478308],[-0.382817,39.480517]]],"type":"Polygon"},"properties":{"marker-size":"small","title":"Districte de Ciutat Vella","marker-color":"#4682B4","stroke-opacity":0.6,"fill-opacity":0.4,"fill":"#F5DEB3"}}],"type":"FeatureCollection"}]</mapframe>

Område med Wikidata /OSM-data

{{map draw
 | geotype = geoshape
 | ids = Q24260,Q24269,Q24272,Q24276,Q2522163,Q24282,Q24286
 | fill = #CDC9C9
 | text = [[Andorras parròquies]]
}}

<mapframe align="right" height="300" text="Andorras parròquies" width="300" zoom="9">[{"properties":{"title":"geoshape1","fill":"#CDC9C9"},"type":"ExternalData","service":"geoshape","ids":"Q24260,Q24269,Q24272,Q24276,Q2522163,Q24282,Q24286"}]</mapframe>

Område med OSM-data, kombinert med markert område

{{map draw |zoom=7 |frameless=s |latitude=41.7 |longitude=1.7
   |geotype1=geoshape |ids1=Q12600 | fill1=#0000CD
   |geotype2=geomask |stroke-width2=1 | fill-opacity2=0.2
   |ids2= Q15365,Q6904,Q15355,Q12720,Q12704,Q15352,Q15346,Q15361,Q15364,
Q12768,Q15351,Q15362,Q15348,Q15345,Q12787,Q15368,Q15354,Q12732,Q10932,
Q12752,Q12600,Q9035550,Q15367,Q12726,Q12793,Q12723,Q12719,Q12762,Q12728,
Q15377,Q15374,Q10930,Q12733,Q12727,Q12778,Q12734,Q15360,Q15376,Q12729,
Q12602,Q13948,Q14303,Q4895313
  }}

<mapframe align="right" frameless="1" height="300" latitude="41.7" longitude="1.7" width="300" zoom="7">[{"properties":{"title":"geoshape1","fill":"#0000CD"},"type":"ExternalData","service":"geoshape","ids":"Q12600"},{"properties":{"stroke-width":1,"fill-opacity":0.2,"title":"geomask2"},"type":"ExternalData","service":"geomask","ids":"Q15365,Q6904,Q15355,Q12720,Q12704,Q15352,Q15346,Q15361,Q15364,Q12768,Q15351,Q15362,Q15348,Q15345,Q12787,Q15368,Q15354,Q12732,Q10932,Q12752,Q12600,Q9035550,Q15367,Q12726,Q12793,Q12723,Q12719,Q12762,Q12728,Q15377,Q15374,Q10930,Q12733,Q12727,Q12778,Q12734,Q15360,Q15376,Q12729,Q12602,Q13948,Q14303"}]</mapframe>

Område med OSM-data, kombinert med markert område

{{map draw |zoom=9 |frameless=s
   |geotype1=geoshape |ids1=Q11492 | fill1=#0000CD
   |geotype2=geomask |ids2=Q12600 | fill-opacity2=0.2
  }}

<mapframe align="right" frameless="1" height="300" width="300" zoom="9">[{"properties":{"title":"geoshape1","fill":"#0000CD"},"type":"ExternalData","service":"geoshape","ids":"Q11492"},{"properties":{"title":"geomask2","fill-opacity":0.2},"type":"ExternalData","service":"geomask","ids":"Q12600"}]</mapframe>

Linje med OSM-data

{{map draw
 | type = maplink
 | class = no-icon
 | geotype = geoline
 | ids = Q25203036
 | stroke = #ff0000
 | text = Kart: National Highway 2 (India)
}}

<maplink class="no-icon" text="Kart: National Highway 2 (India)">[{"properties":{"stroke":"#ff0000","title":"geoline1"},"type":"ExternalData","service":"geoline","ids":"Q25203036"}]</maplink>

Med data fra Commons (se c:Data:Jordan.map) og med (Q810) (tilknyttet Wikidata-side)

{{map draw
 | item = Q810
 | commons = Jordan.map
}}

<mapframe align="right" height="300" width="300" zoom="9">[{"properties":{"title":"page1"},"type":"ExternalData","title":"Jordan.map","service":"page"}]</mapframe>

Med data fra Commons (se c:Data:Riu Segre.map, hvor det er sekvensen av koordinater for elveløpet)

{{map draw
 | commons1 = Riu Segre.map   
 | coordinates2 = 42.4025, 2.1084
 | title2 = Kilde: Llo
 | coordinates3 = 41.363656, 0.302644
 | title3 = Munning: Ebro ved Mequinensa
}}

<mapframe align="right" height="300" latitude="41.883078" longitude="1.205522" width="300" zoom="7">[{"properties":{"title":"page1"},"type":"ExternalData","title":"Riu Segre.map","service":"page"},{"features":[{"type":"Feature","geometry":{"coordinates":[2.1084,42.4025],"type":"Point"},"properties":{"title":"Kilde: Llo"}},{"type":"Feature","geometry":{"coordinates":[0.302644,41.363656],"type":"Point"},"properties":{"title":"Munning: Ebro ved Mequinensa"}}],"type":"FeatureCollection"}]</mapframe>

Med OSM-data, koordinater for kartets midtpunkt og endret kartformat

{{map draw
 | latitude       = 33
 | longitude      = 140
 | height         = 500
 | width          = 280
 | zoom           = 5
 | geotype        = geoshape
 | ids            = Q1490
 | stroke         = #ff0000
 | text           = Tokyo prefektur
 | stroke-width   = 1
 | stroke-opacity = 1
 | fill           = #00ff00
 | fill-opacity   = 0.2
}}

<mapframe align="right" height="500" latitude="33" longitude="140" text="Tokyo prefektur" width="280" zoom="5">[{"properties":{"title":"geoshape1","fill-opacity":0.2,"stroke-width":1,"stroke":"#ff0000","stroke-opacity":1,"fill":"#00ff00"},"type":"ExternalData","service":"geoshape","ids":"Q1490"}]</mapframe>