diff --git a/PacticeSolution/MapFinder/MainWindow.xaml b/PacticeSolution/MapFinder/MainWindow.xaml
index 16d3778..81b0618 100644
--- a/PacticeSolution/MapFinder/MainWindow.xaml
+++ b/PacticeSolution/MapFinder/MainWindow.xaml
@@ -5,16 +5,17 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MapFinder"
mc:Ignorable="d"
- Title="MainWindow" Height="450" Width="800">
+ Title="Map Finder" Height="450" Width="800"
+ Loaded="Window_Loaded">
+
-
-
-
-
+
+
+
-
+ Grid.ColumnSpan="3"/>-->
+
diff --git a/PacticeSolution/MapFinder/MainWindow.xaml.cs b/PacticeSolution/MapFinder/MainWindow.xaml.cs
index 1ceab35..e8ac4e7 100644
--- a/PacticeSolution/MapFinder/MainWindow.xaml.cs
+++ b/PacticeSolution/MapFinder/MainWindow.xaml.cs
@@ -1,5 +1,6 @@
using MapFinder.Data;
using MapFinder.Utility;
+using Microsoft.VisualBasic.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -9,7 +10,9 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
+using System.Windows.Forms;
using System.Windows.Input;
+using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
@@ -22,10 +25,28 @@ namespace MapFinder
///
public partial class MainWindow : Window
{
+ System.Windows.Forms.WebBrowser _webBrowser;
+
public MainWindow()
{
InitializeComponent();
+ InitInstance();
+ }
+
+ private void InitInstance()
+ {
+ _webBrowser = new System.Windows.Forms.WebBrowser();
+ wfhWebBrowser.Child = _webBrowser;
+ _webBrowser.ScriptErrorsSuppressed = true;
+ _webBrowser.Navigate("https://map.naver.com/");
+ }
+ private double[] ConvertToEPSG3857(double lat, double lng)
+ {
+ var x = (lng * 20037508.34) / 180;
+ var y = Math.Log(Math.Tan(((90 + lat) * Math.PI) / 360)) / (Math.PI / 180);
+ y = (y * 20037508.34) / 180;
+ return new double[] { x, y };
}
private void btnFind_Click(object sender, RoutedEventArgs e)
@@ -43,8 +64,23 @@ namespace MapFinder
if (selected == null)
return;
- Uri uri = new Uri($"https://map.kakao.com/link/map/{selected.Name},{selected.Lat},{selected.Lng}");
- wbMain.Source = uri;
+ double[] epsg3857 = ConvertToEPSG3857(selected.Lat, selected.Lng);
+ string url = $"http://map.naver.com/v5/search?c={epsg3857[0]},{epsg3857[1]},{18},0,0,0,dh";
+
+ //string url = $"https://google.co.kr/maps/@{selected.Lat},{selected.Lng},11z";
+ //string url = $"https://map.kakao.com/link/map/{selected.Name},{selected.Lat},{selected.Lng}";
+ //Uri uri = new Uri(url);
+ //wbMain.Source = uri;
+
+ _webBrowser.Navigate(url);
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ //System.Windows.Forms.WebBrowser webBrowser = new System.Windows.Forms.WebBrowser();
+ //webBrowser.ScriptErrorsSuppressed = true;
+ //wfhWebBrowser.Child = webBrowser;
+ //webBrowser.Navigate("https://map.kakao.com");
}
}
}
diff --git a/PacticeSolution/MapFinder/MapFinder.csproj b/PacticeSolution/MapFinder/MapFinder.csproj
index 72c5feb..bb654db 100644
--- a/PacticeSolution/MapFinder/MapFinder.csproj
+++ b/PacticeSolution/MapFinder/MapFinder.csproj
@@ -5,6 +5,7 @@
net6.0-windows
enable
true
+ true