Timothy Jaeryang Baek 7 ماه پیش
والد
کامیت
bb506edcc3
1فایلهای تغییر یافته به همراه9 افزوده شده و 0 حذف شده
  1. 9 0
      src/lib/components/common/Valves/MapSelector.svelte

+ 9 - 0
src/lib/components/common/Valves/MapSelector.svelte

@@ -41,6 +41,15 @@
 	onMount(async () => {
 		map = L.map(mapElement).setView(setViewLocation ? setViewLocation : [51.505, -0.09], 10);
 
+		if (setViewLocation) {
+			points = [
+				{
+					coords: setViewLocation,
+					content: `Lat: ${setViewLocation[0]}, Lng: ${setViewLocation[1]}`
+				}
+			];
+		}
+
 		L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
 			attribution:
 				'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'