soiz1 commited on
Commit
c406cdc
ยท
verified ยท
1 Parent(s): 129ff86

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +2 -54
index.html CHANGED
@@ -198,6 +198,8 @@ function loadMapFromStorage() {
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";
@@ -506,60 +508,6 @@ map.on("contextmenu", function (e) {
506
  openEditor(clickedMarkers[0]);
507
  }
508
  });
509
- // ใƒœใ‚ฟใƒณใ‚’้…็ฝฎใ™ใ‚‹ใ‚ณใƒณใƒ†ใƒŠใ‚’ไฝœๆˆ
510
- const buttonContainer = document.createElement("div");
511
- buttonContainer.style.position = "absolute";
512
- buttonContainer.style.top = "10px";
513
- buttonContainer.style.left = "10px";
514
- buttonContainer.style.zIndex = "1000";
515
- buttonContainer.style.display = "flex";
516
- buttonContainer.style.gap = "10px";
517
- document.body.appendChild(buttonContainer);
518
-
519
- // ใ€Œๆ–ฐใ—ใใƒžใƒผใ‚ซใƒผใ‚’่ฟฝๅŠ ใ€ใƒœใ‚ฟใƒณใ‚’ไฝœๆˆ
520
- const addMarkerButton = document.createElement("button");
521
- addMarkerButton.textContent = "ๆ–ฐใ—ใใƒžใƒผใ‚ซใƒผใ‚’่ฟฝๅŠ ";
522
- addMarkerButton.style.padding = "10px";
523
- addMarkerButton.style.border = "none";
524
- addMarkerButton.style.borderRadius = "5px";
525
- addMarkerButton.style.background = "#007BFF";
526
- addMarkerButton.style.color = "white";
527
- addMarkerButton.style.cursor = "pointer";
528
- addMarkerButton.addEventListener("click", () => {
529
- const center = map.getCenter();
530
- const newMarker = L.marker(center).addTo(map);
531
- newMarker.bindPopup("ๆ–ฐใ—ใ„ใƒžใƒผใ‚ซใƒผ").openPopup();
532
- newMarker.bindTooltip("ๆ–ฐใ—ใ„ใƒžใƒผใ‚ซใƒผใฎใƒ„ใƒผใƒซใƒใƒƒใƒ—");
533
- newMarker.on("mouseover", function () {
534
- hoveredMarker = newMarker;
535
- });
536
- newMarker.on("mouseout", function () {
537
- if (hoveredMarker === newMarker) {
538
- hoveredMarker = null;
539
- }
540
- });
541
- saveMapToStorage();
542
- });
543
- buttonContainer.appendChild(addMarkerButton);
544
-
545
- // ใ€Œใƒžใƒผใ‚ซใƒผใ‚’็ทจ้›†ใ€ใƒœใ‚ฟใƒณใ‚’ไฝœๆˆ
546
- const editMarkerButton = document.createElement("button");
547
- editMarkerButton.textContent = "ใƒžใƒผใ‚ซใƒผใ‚’็ทจ้›†";
548
- editMarkerButton.style.padding = "10px";
549
- editMarkerButton.style.border = "none";
550
- editMarkerButton.style.borderRadius = "5px";
551
- editMarkerButton.style.background = "#28A745";
552
- editMarkerButton.style.color = "white";
553
- editMarkerButton.style.cursor = "pointer";
554
- editMarkerButton.addEventListener("click", () => {
555
- if (hoveredMarker) {
556
- openEditor(hoveredMarker);
557
- } else {
558
- alert("็ทจ้›†ใ™ใ‚‹ใƒžใƒผใ‚ซใƒผใ‚’้ธๆŠžใ—ใฆใใ ใ•ใ„ใ€‚");
559
- }
560
- });
561
- buttonContainer.appendChild(editMarkerButton);
562
-
563
 
564
  // ใƒžใƒƒใƒ—ใŒๅ‹•ใ„ใŸใจใใซไฟๅญ˜
565
  </script>
 
198
  const t = e.getLatLng();
199
  document.getElementById("marker-lat").value = t.lat;
200
  document.getElementById("marker-lng").value = t.lng;
201
+ document.getElementById("icon-width").value = t.options.icon.options.iconSize[0];
202
+ document.getElementById("icon-height").value = t.options.icon.options.iconSize[1];
203
  document.getElementById("marker-popup").value = e.getPopup() ? e.getPopup().getContent() : "";
204
  document.getElementById("marker-tooltip").value = e.getTooltip() ? e.getTooltip().getContent() : "";
205
  document.getElementById("marker-editor").style.display = "block";
 
508
  openEditor(clickedMarkers[0]);
509
  }
510
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
 
512
  // ใƒžใƒƒใƒ—ใŒๅ‹•ใ„ใŸใจใใซไฟๅญ˜
513
  </script>