微件:Map:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
| (未显示同一用户的8个中间版本) | |||
| 第1行: | 第1行: | ||
<noinclude> | <noinclude> | ||
{{#widget:map|map=701|size=396}} | {{#widget:map|map=701|size=396}} | ||
</noinclude><includeonly><canvas id="map-<!--{$map|escape:'quotes'}-->" width='1024' height='576' style='background-image:url(/wg_img/ccbResources/map/<!--{$map|escape:' | </noinclude><includeonly><canvas id="map-<!--{$map|escape:'quotes'}-->" width='1024' height='576' style="width:<!--{$size|escape:'quotes'}-->px;background-image:url(/wg_img/ccbResources/map/<!--{$map|escape:'quotes'}-->.jpg); background-position:center; background-size:<!--{$size|escape:'quotes'}-->px auto;"></canvas><script src='https://zjsnrwiki.github.io/data/pveData.js'></script><script>(function() { | ||
var mapId = "<!--{$map|escape:'quotes'}-->"; | var mapId = "<!--{$map|escape:'quotes'}-->"; | ||
var | var w = parseInt("<!--{$size|escape:'quotes'}-->"); | ||
var w | var h = w * 576 / 1024; | ||
var mapCanvas = document.getElementById('map-' + mapId); | var mapCanvas = document.getElementById('map-' + mapId); | ||
mapCanvas.style.height = h + 'px'; | mapCanvas.style.height = h + 'px'; | ||
| 第106行: | 第106行: | ||
var map = mapCanvas.getContext('2d'); | var map = mapCanvas.getContext('2d'); | ||
map.font = 'bold | map.font = 'bold 2em "Noto Sans", sans-serif'; | ||
map.textAlign = 'center'; | map.textAlign = 'center'; | ||
map.fillStyle = 'white'; | map.fillStyle = 'white'; | ||
map.strokeStype = 'black'; | map.strokeStype = 'black'; | ||
map.lineWidth = | map.lineWidth = 5; | ||
var labels = '0ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | var labels = '0ABCDEFGHIJKLMNOPQRSTUVWXYZ'; | ||
for (var i = 1; i < nodes.length; ++i) { | for (var i = 1; i < nodes.length; ++i) { | ||
var x = nodes[i].x * 384; | var x = nodes[i].x * 384; | ||
var y = 576 - nodes[i].y * 384 - (nodes[i].type == 2 ? | var y = 576 - nodes[i].y * 384 - (nodes[i].type == 2 ? 40 : 30); | ||
map.strokeText(labels[i], x, y); | map.strokeText(labels[i], x, y); | ||
map.fillText(labels[i], x, y); | map.fillText(labels[i], x, y); | ||
} | } | ||
} | } | ||
</script></includeonly> | }());</script></includeonly> | ||
2016年10月8日 (六) 00:37的最新版本