Spaces:
Running
Running
Update index.html
Browse files- index.html +42 -13
index.html
CHANGED
|
@@ -194,21 +194,50 @@ function loadMapFromStorage() {
|
|
| 194 |
}
|
| 195 |
}
|
| 196 |
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
}
|
| 211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 212 |
function generateMapHTML() {
|
| 213 |
const e = [];
|
| 214 |
map.eachLayer((function(t) {
|
|
|
|
| 194 |
}
|
| 195 |
}
|
| 196 |
|
| 197 |
+
function openEditor(e) {
|
| 198 |
+
const t = e.getLatLng();
|
| 199 |
+
document.getElementById("marker-lat").value = t.lat;
|
| 200 |
+
document.getElementById("marker-lng").value = t.lng;
|
| 201 |
+
document.getElementById("marker-popup").value = e.getPopup() ? e.getPopup().getContent() : "";
|
| 202 |
+
document.getElementById("marker-tooltip").value = e.getTooltip() ? e.getTooltip().getContent() : "";
|
| 203 |
+
document.getElementById("marker-editor").style.display = "block";
|
| 204 |
+
editingMarker = e;
|
| 205 |
+
|
| 206 |
+
// ここから追加
|
| 207 |
+
const icon = e.options.icon;
|
| 208 |
+
if (icon && icon.options) {
|
| 209 |
+
if (icon.options.iconUrl) {
|
| 210 |
+
// URLから読み込むラジオボタンを選択
|
| 211 |
+
document.querySelector('input[name="icon-source"][value="url"]').checked = true;
|
| 212 |
+
document.getElementById("icon-url-input").style.display = "block";
|
| 213 |
+
document.getElementById("icon-upload-input").style.display = "none";
|
| 214 |
+
document.getElementById("marker-icon-url").value = icon.options.iconUrl;
|
| 215 |
+
document.getElementById("icon-preview").src = icon.options.iconUrl;
|
| 216 |
+
document.getElementById("icon-preview").style.display = 'block';
|
| 217 |
+
// 高さと幅の設定を表示
|
| 218 |
+
document.getElementById("icon-settings").style.display = "block";
|
| 219 |
+
} else {
|
| 220 |
+
// URLから読み込むラジオボタンを選択
|
| 221 |
+
document.querySelector('input[name="icon-source"][value="upload"]').checked = true;
|
| 222 |
+
document.getElementById("icon-url-input").style.display = "none";
|
| 223 |
+
document.getElementById("icon-upload-input").style.display = "block";
|
| 224 |
+
document.getElementById("marker-icon-url").value = "https://unpkg.com/leaflet@1.9.3/dist/images/marker-icon-2x.png";
|
| 225 |
+
document.getElementById("icon-preview").src = "https://unpkg.com/leaflet@1.9.3/dist/images/marker-icon-2x.png";
|
| 226 |
+
document.getElementById("icon-preview").style.display = 'block';
|
| 227 |
+
// 高さと幅の設定を表示
|
| 228 |
+
document.getElementById("icon-settings").style.display = "block";
|
| 229 |
}
|
| 230 |
|
| 231 |
+
document.getElementById("icon-width").value = icon.options.iconSize[0];
|
| 232 |
+
document.getElementById("icon-height").value = icon.options.iconSize[1];
|
| 233 |
+
document.getElementById("icon-width-value").textContent = icon.options.iconSize[0];
|
| 234 |
+
document.getElementById("icon-height-value").textContent = icon.options.iconSize[1];
|
| 235 |
+
}
|
| 236 |
+
// ここまで追加
|
| 237 |
+
|
| 238 |
+
updatePreviewSize();
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
function generateMapHTML() {
|
| 242 |
const e = [];
|
| 243 |
map.eachLayer((function(t) {
|