Spaces:
Running
Running
Update index.html
Browse files- 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>
|