diff --git a/map4.js b/map4.js index ba2dd33..8da6a35 100644 --- a/map4.js +++ b/map4.js @@ -141,14 +141,15 @@ // ピン生成(自分:緑 / 他人:金) // =================================== function createLabeledMarker(lat, lng, name, isSelf) { + const pinUrl = isSelf ? "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-green.png" : "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-gold.png"; const html = ` -
- -
${name}
+
+ +
${name}
`; @@ -156,9 +157,9 @@ icon: L.divIcon({ className: "custom-pin", html: html, - iconSize: [32, 48], // 見た目用のおおよそのサイズ - iconAnchor: [16, 40], // 下中央あたりを地図の座標に - }), + iconSize: [40, 50], // ピン+ラベルの領域 + iconAnchor: [20, 50], // 下中央を位置座標に合わせる + }) }); }