Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Usage  



1.1  Basic  





1.2  Using specified coordinates instead of Wikidata  





1.3  Customizing which features are displayed  



1.3.1  Inverse shape  





1.3.2  Turn point marker on or off  





1.3.3  Turn shape feature off  





1.3.4  Turn line feature off  







1.4  Show a geomask from a related Wikidata item  





1.5  Determine zoom from object length or area  







2 Parameters  





3 Examples for use within templates  





4 FAQ  





5 TemplateData  





6 See also  














Template:Infobox mapframe






Адыгэбзэ
Afrikaans
Ænglisc
Аԥсшәа
العربية
Արեւմտահայերէն
Azərbaycanca
تۆرکجه
Basa Bali

 / Bân-lâm-gú
Basa Banyumasan

Bikol Central
Bosanski
Буряад
Cebuano
Dansk
Ελληνικά
Esperanto
فارسی
Français
Frysk

/Hak-kâ-ngî

Հայերեն
ि
Hrvatski
Bahasa Hulontalo
Ilokano
Bahasa Indonesia
Ирон
Íslenska
Jawa

Kurdî
Ladin
Latviešu
Li Niha
Magyar
Madhurâ
ि
Македонски




Bahasa Melayu
Minangkabau
 / Mìng-dĕ̤ng-nḡ
Мокшень
Монгол



Нохчийн
Oʻzbekcha / ўзбекча


Română
Русский
Scots
Simple English
سنڌي
Slovenščina
کوردی
Српски / srpski
Sunda
Tagalog
ி
 

Türkçe
Українська
اردو
ئۇيغۇرچە / Uyghurche
Tiếng Vit

Yorùbá


Dusun Bundu-liwan
 

Edit links
 









Template
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Wikimedia Commons
 
















Appearance
   

 





Permanently protected template

From Wikipedia, the free encyclopedia
 


Map

This template generates a mapframe map, suitable for infoboxes, with minimal user input. This template only works with single features (points, lines, or shapes); use {{maplink}} if more advanced options, such as displaying multiple features, are required.

If coordinates are not supplied, they will be fetched from the page's Wikidata item. In such cases, if |point= is not set, then a point feature marker is displayed at those coordinates unless the Wikidata item has an OpenStreetMap relation ID (P402) specified.

Usage

Note: When in mainspace, parameter |id= is not required (except to use a different page's data)

Basic

{{Infobox mapframe}}

When used without parameters, or with only |id=, the map will display either a shape, line, or point feature, depending on the data available on Wikidata and OpenStreetMap.

Basic usage examples

Point feature (Wikidata coordinates):

{{Infobox mapframe |id=Q7270550}}

Map Line feature:

{{Infobox mapframe |id=Q1318331}}

Map Shape feature:

{{Infobox mapframe |id=Q61}}

Map

Using specified coordinates instead of Wikidata

Point feature only, no shapes or lines:

{{Infobox mapframe |coord=}}

Point feature and shape/line feature if available:

{{Infobox mapframe |wikidata=yes |coord=}}

Specify coordinates using the {{Coord}} templates, e.g. |coord={{Coord|32.1|S|116.2|E}}

Specified coordinates examples

Point feature (with coordinates specified, no shape/line feature from Wikidata item):

{{infobox mapframe |coord={{coord|31|56|S|115|58|E}} }}

Map Point feature (with coordinates specified, along with shape/line feature from Wikidata item):

{{infobox mapframe |wikidata=yes |coord={{coord|31|56|S|115|58|E}} }}

Map

Customizing which features are displayed

Inverse shape

{{Infobox mapframe |shape=inverse}}

Replace the shape with an inverse-shape (geomask) by setting |shape=inverse

Inverse shape example

{{Infobox mapframe |id=Q61 |shape=inverse}}

Map

Turn point marker on or off

Force point marker to be displayed:

{{Infobox mapframe |point=on}}

Prevent point marker from being displayed:

{{Infobox mapframe |point=none}}

Turn shape feature off

Prevent shape feature from being displayed:

{{Infobox mapframe |shape=none}}

Turn line feature off

Prevent line feature from being displayed:

{{Infobox mapframe |line=none}}

Show a geomask from a related Wikidata item

{{Infobox mapframe |geomask=}}

Set |geomask= to a Wikidata item id (Q-number), or property id (P-number) such as country (P17)

Geomask examples

Use the item linked from the country (P17) statement as a geomask:

{{Infobox mapframe |id=Q3239281 |geomask=P17}}

Map Use the item Hesse (Q1199) as a geomask:

{{Infobox mapframe |id=Q3239281 |geomask=Q1199}}

Map

Determine zoom from object length or area

Use |length_km=or|length_mi=or|area_km2=or|area_mi2=

Zoom from length/area examples

Determine zoom from object length in kilometres or miles

{{Infobox mapframe |id=Q1318331 |length_km=5.6}}
{{Infobox mapframe |id=Q1318331 |length_mi=3.5}}

Map Determine zoom from object area in square kilometres or square miles

{{Infobox mapframe |id=Q100 |area_km2=232.14}}
{{Infobox mapframe |id=Q100 |area_mi2=89.63}}

Map

Parameters

All parameters are optional.

  • talk
  • edit
  • Examples for use within templates

    Infobox hospital

    {{Infobox hospital}} (as of 5 October 2019)

    |image3    = {{yesno|{{{mapframe|yes}}}|no=|yes={{Infobox mapframe
     |zoom={{{mapframe-zoom|}}}
     |frame-width={{{mapframe-width|}}}
     |frame-height={{{mapframe-height|}}}
     |marker={{{mapframe-marker|hospital}}}
     |marker-color={{{mapframe-marker-color|{{{mapframe-marker-colour|}}}}}}
     |frame-lat={{{mapframe-lat|{{{mapframe-latitude|}}}}}}
     |frame-long={{{mapframe-long|{{{mapframe-longitude|}}}}}}
     |stroke-color={{{mapframe-stroke-color|{{{mapframe-stroke-colour|}}}}}}
     }}
    }}
    |caption3 = {{yesno|{{{mapframe|yes}}}|no=|yes={{{mapframe-caption|}}}}}
    

    Infobox power station

    {{Infobox power station}} (as of 2 April 2019):

    | image2        = {{#ifeq:{{{location_map|}}}|no|<!-- -->|{{Infobox mapframe
                      |id= {{{qid|}}}
                      |coord                 = {{{coordinates|}}}
                      |frame-width           = {{Digits|1={{#if:{{{image_size|}}}|{{{image_size|}}}|300px}}}}
                      |marker                = industrial
                      |zoom                  = {{#if:{{{location_map_geomask|}}}|{{{location_map_zoom|}}}|{{{location_map_zoom|5}}}}}
                      |geomask               = {{#ifeq:{{{location_map_geomask|}}}|Yes|P17|<!-- -->}}
                      |geomask-stroke-width  = {{#ifeq:{{{location_map_geomask|}}}|Yes|0.5|<!-- -->}}
                      |geomask-stroke-colour = {{#ifeq:{{{location_map_geomask|}}}|Yes|#000000|<!-- -->}}
                      |geomask-fill          = {{#ifeq:{{{location_map_geomask|}}}|Yes|#BABABA|<!-- -->}}
                      }}}}
    | caption2      = {{#ifeq:{{{location_map|}}}|no|<!-- -->|{{#if:{{{coordinates|}}}{{#property:P625}}|{{{location_map_caption|}}}}}}}
    

    Infobox Australian road

    {{Infobox Australian road}} (as of 5 October 2019):

    | data3        = {{#ifexist:media:{{{location|}}}<!--
    -->|[[File:{{{location}}}|270px|frameless|alt={{{location_alt|{{{loc_alt|{{{alt|}}}}}}}}}]]<!--
    -->|{{{location|<!--
       -->{{yesno| {{{mapframe|yes}}}<!--
       -->|no=<!--
       -->|yes={{Infobox mapframe | length_km={{{length|}}} }}<!-- Tracking category:
        -->{{main other|{{#if:{{#property:P625}}|[[Category:Infobox Australian road articles with an infobox mapframe map|{{#if:{{{coordinates_a|}}}|π}}{{PAGENAME}}]]}}}}<!--
       -->}}<!--
     -->}}}<!--
    -->}}
    

    FAQ

    Q1: Where to file a bug report when there is a problem with the base map? (e.g. a missing lake)
    A1: If the problem also occurs on OpenStreetMap, it needs to be fixed there. If the problem is only on Wikimedia's maps, it can be reported on Phabricator (you can log in with you Wikipedia account). See mw:How to report a bug for instructions (for the tags, use Maps). (Alternatively, you can try mw:Help talk:Extension:Kartographer)
    Q2: Where to report other bugs or problems with the maps?
    A2: This may be a problem with the Wikipedia module, or it may be an underlying software bug (there are lots of those).
  • If the problem only occurs with Wikipedia's template/module, or you're not sure, report it here. (Alternatively, you can try Wikipedia:Village pump (technical))
  • Q3: Why does the thumbnail map render as a static image when viewing pages, but is interactive when editing pages?
    A3: On Wikipedia, and most wikis other than Wikivoyage, the emdeded thumbnail is a static map, and the full screen map needs to be opened before the map can be zoomed or panned. This is for for performance reasons, and to present some content if javascript is disabled, and for printing.
    That preview mode shows an interactive map is a bug, phab:T203863 (and also a performance issue). Further explanation can be found in the comments on phab:T202793.
    Q4: Why is a line or shape feature from OpenStreetMap not being shown?
    A4: There are several possible causes:
  • Only certain OSM relations (those with type=multipolygon, type=route, type=waterway and type=boundary) can be used, and not others like buildings and public transport master routes. See mw:Help:Extension:Kartographer/OSM#Limitation and phab:T156433.
  • It can take 1 or 2 days after tagging on OSM before the data is available here.
  • Wikimedia occasionally has problems replicating OSM data (e.g. phab:T218097), or intentionally disables replication due to other problems (e.g. phab:T243609)
  • Q5: Why are line, shape, or point features are not shown after editing or adding a map, even though they were shown in the page preview?
    A5: This is a bug related to generating thumbnail map images. It should fix itself in an hour or two. See phab:T269984 for details.
    Q6: A page using mapframe's |raw= parameter is showing error messages of "The time allocated for running scripts has expired." What can be done?
    A6: If the amount of raw data to be processed is too large, that timeout message may be shown. You can try moving the raw data to Commons (example) or replacing the mapframe template with the equivalent wikitext using Special:ExpandTemplates (example)

    TemplateData

    This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Infobox mapframe in articles based on its TemplateData.

    TemplateData for Infobox mapframe

    parameters

    No description.

    Template parameters[Edit template data]

    ParameterDescriptionTypeStatus
    mapframemapframe alias

    =yes will create a map

    Default
    no
    Booleanoptional
    mapframe-captionmapframe-caption

    no description

    Unknownoptional
    mapframe-custommapframe-custom

    no description

    Unknownoptional
    qidqid

    no description

    Unknownoptional
    coordinatescoordinates

    no description

    Unknownoptional
    mapframe-wikidatamapframe-wikidata

    no description

    Unknownoptional
    mapframe-shapemapframe-shape

    no description

    Unknownoptional
    mapframe-pointmapframe-point

    no description

    Unknownoptional
    mapframe-linemapframe-line

    no description

    Unknownoptional
    mapframe-geomaskmapframe-geomask

    no description

    Unknownoptional
    mapframe-switchermapframe-switcher

    no description

    Unknownoptional
    mapframe-frame-widthmapframe-frame-width

    no description

    Unknownoptional
    mapframe-frame-heightmapframe-frame-height

    no description

    Unknownoptional
    mapframe-shape-fillmapframe-shape-fill

    no description

    Unknownoptional
    mapframe-shape-fill-opacitymapframe-shape-fill-opacity

    no description

    Unknownoptional
    mapframe-stroke-colormapframe-stroke-color

    no description

    Unknownoptional
    mapframe-stroke-widthmapframe-stroke-width

    no description

    Unknownoptional
    mapframe-markermapframe-marker

    no description

    Unknownoptional
    mapframe-marker-colormapframe-marker-color

    no description

    Unknownoptional
    mapframe-geomask-stroke-colormapframe-geomask-stroke-color

    no description

    Unknownoptional
    mapframe-geomask-stroke-widthmapframe-geomask-stroke-width

    no description

    Unknownoptional
    mapframe-geomask-fillmapframe-geomask-fill

    no description

    Unknownoptional
    mapframe-geomask-fill-opacitymapframe-geomask-fill-opacity

    no description

    Unknownoptional
    mapframe-zoommapframe-zoom

    no description

    Unknownoptional
    mapframe-length_kmmapframe-length_km

    no description

    Unknownoptional
    mapframe-length_mimapframe-length_mi

    no description

    Unknownoptional
    mapframe-area_km2mapframe-area_km2

    no description

    Unknownoptional
    mapframe-area_mi2mapframe-area_mi2

    no description

    Unknownoptional
    mapframe-frame-coordinatesmapframe-frame-coordinates

    no description

    Unknownoptional

    See also


    Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:Infobox_mapframe&oldid=852933415"

    Categories: 
    Lua-based templates
    Templates using data from Wikidata
    Templates tracking Wikidata
    Hidden categories: 
    Wikipedia template-protected templates
    Infobox mapframe without OSM relation ID on Wikidata
    Templates using TemplateData
    Pages using the Kartographer extension
     



    This page was last edited on 1 August 2018, at 10:02 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki