Widget:Chartlet static
From CruisersWiki
(Difference between revisions)
m |
|||
(28 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
- | <!--{ | + | <includeonly><!--{* see Template:Chartlet static *}--><!--{ |
assign var='c' value=$lat}--><!--{ | assign var='c' value=$lat}--><!--{ | ||
assign var='d' value=$c|regex_replace:"/([^ ]+) ([^ ]+) ([^ ]+)/":"\\1"}--><!--{ | assign var='d' value=$c|regex_replace:"/([^ ]+) ([^ ]+) ([^ ]+)/":"\\1"}--><!--{ | ||
Line 19: | Line 19: | ||
assign var='lon' value=$d}--><!--{ | assign var='lon' value=$d}--><!--{ | ||
/if}--><!--{ | /if}--><!--{ | ||
- | assign var='w' value=$width | + | assign var='w' value=$width|replace:"px":"" |
}--><!--{ | }--><!--{ | ||
- | assign var='h' value=$height| | + | assign var='h' value=$height|replace:"px":"" |
- | }-->img class="chartlet-static" src="https://maps.wikimedia.org/img/osm-intl,<!--{$zoom}-->,<!--{$lat}-->,<!--{$lon}-->,<!--{$w}-->x<!--{$h}-->.png" | + | }--><!--{ |
+ | assign var='url' value="http://staticmap.openstreetmap.de/staticmap.php?center=`$lat`,`$lon`&zoom=`$zoom`&size=`$w`x`$h`&maptype=mapnik"|escape | ||
+ | }--><!--{ | ||
+ | assign var='style' value="width:`$width`; height:`$height`; background-image:url($url)"|escape | ||
+ | }--><noscript><img class="chartlet-static" src="<!--{$url}-->"></noscript><!--{* | ||
+ | |||
+ | for whatever reason every other instance of <noscript> does not work, so it is to be repeated | ||
+ | |||
+ | *}--><noscript></noscript></includeonly><noinclude> | ||
+ | |||
+ | <!--------------------------------------------> | ||
+ | |||
+ | see [[Template:Chartlet static]] | ||
+ | |||
+ | <div style="display:none"> <!-- the following is a comment --> | ||
+ | |||
+ | *** https://wiki.openstreetmap.org/wiki/StaticMapLite | ||
+ | |||
+ | div class="chartlet-static" style="width:<!--{$width}-->; height:<!--{$height}-->; background-image:url(http://staticmap.openstreetmap.de/staticmap.php?center=<!--{$lat}-->,<!--{$lon}-->&zoom=<!--{$zoom}-->&size=<!--{$w}-->x<!--{$h}-->&maptype=mapnik)" | ||
+ | |||
+ | img class="chartlet-static" src="<!--{$url}-->" | ||
+ | |||
+ | *** wikimedia | ||
+ | |||
+ | div class="chartlet-static" style="width:<!--{$width}-->; height:<!--{$height}-->; background-image:url(https://maps.wikimedia.org/img/osm-intl,<!--{$zoom}-->,<!--{$lat}-->,<!--{$lon}-->,<!--{$w}-->x<!--{$h}-->.png)" | ||
+ | |||
+ | assign var='url' value=https://maps.wikimedia.org/img/osm-intl,`$zoom`,`$lat`,`$lon`,`$w`x`$h`.png | ||
+ | |||
+ | </div> | ||
+ | </noinclude> |
Latest revision as of 13:28, 15 November 2018