Difference between revisions of "Template:Kerbalmaps"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (!floating point modulo;)
(+support additional parameters; +reference to forum;)
Line 1: Line 1:
<includeonly>[http://www.kerbalmaps.com/?body={{{3|Kerbin}}}&loc={{#expr: {{{1|0}}} fmod 180}},{{#expr: {{{2|0}}} fmod 180}} {{{text|Map}}}]</includeonly><noinclude>Links to [http://www.kerbalmaps.com http://www.kerbalmaps.com]. Although the first and second parameter have a default value they are only to avoid invalid links.
+
<includeonly>[http://www.kerbalmaps.com/?body={{{3|Kerbin}}}{{#if: {{{overlays|}}}|&overlays={{{overlays}}}}}&loc={{#expr: {{{1|0}}} fmod 180}},{{#expr: {{{2|0}}} fmod 180}}{{Booland|{{{marker text|}}}|{{#ifeq: {{{marker text|}}}|X||1}}|,{{{marker text}}}}}{{#if: {{{zoom|}}}|&zoom={{{zoom}}}|{{#ifeq: {{{marker text|}}}|X|&zoom=5}}}} {{{text|Map}}}]</includeonly><noinclude>Links to [http://www.kerbalmaps.com http://www.kerbalmaps.com]. Although the first and second parameter have a default value they are only to avoid invalid links. Uses the API documented in [[thread:25148|Kerbal Maps: Web maps of all bodies.]] thread by ''saik0''.
 
{{Parameter Table|name=both|parameters=
 
{{Parameter Table|name=both|parameters=
 
{{Parameter Row|1|Latitude. Positive is north, negative is south.}}
 
{{Parameter Row|1|Latitude. Positive is north, negative is south.}}
Line 5: Line 5:
 
{{Parameter Row|3|Name of the [[celestial body]].|<tt>''Kerbin''</tt>}}
 
{{Parameter Row|3|Name of the [[celestial body]].|<tt>''Kerbin''</tt>}}
 
{{Parameter Row|text|Link text shown.|<tt>''Map''</tt>}}
 
{{Parameter Row|text|Link text shown.|<tt>''Map''</tt>}}
 +
{{Parameter Row|marker text|Text for the marker. If set to <tt>X</tt> it won't show a marker at all. Needs to be a URL encoded string.|Not set/Empty text}}
 +
{{Parameter Row|overlays|Comma separated overlays; possible values are: <tt>spacecenters</tt>, <tt>anomalies</tt>, <tt>poi</tt>.|Not set/Empty text}}
 +
{{Parameter Row|zoom|Zoom level from 0 to 5 or <tt>fit</tt>.|<tt>5</tt> if <tt>{{{marker text}}}</tt> is set to <tt>X</tt>}}
 
}}
 
}}
  
 
[[Category:Templates]]</noinclude>
 
[[Category:Templates]]</noinclude>

Revision as of 16:51, 8 November 2013

Links to http://www.kerbalmaps.com. Although the first and second parameter have a default value they are only to avoid invalid links. Uses the API documented in Kerbal Maps: Web maps of all bodies. thread by saik0. Template:Parameter Table