Gmap.net 将路线转换为点
Gmap.net Convert route to points
我有一个 route 从点:A 到点 B。
我想将我的路线转换为点列表(每 3 米)。
有可能 GMap.Net 吗?
是的。我使用点列表 (LatLng) 并且列出了完整的点列表。
''Create my route
Dim sta As New PointLatLng(TextBox1.Text, TextBox2.Text)
Dim sto As New PointLatLng(TextBox4.Text, TextBox3.Text)
Dim route As MapRoute = GMapProviders.OpenStreetMap.GetRoute(sta, sto, False, False, 13)
Dim rs As New GMapRoute(route.Points, "Route1")
Dim iOvrL As New GMapOverlay
iOvrL.Routes.Add(rs)
GMapa.Overlays.Add(iOvrL)
''GET POINTS
For Each point As PointLatLng In rs.Points
Dim pointx As String = point.Lat.ToString()
Dim pointy As String = point.Lng.ToString()
Next
我有一个 route 从点:A 到点 B。
我想将我的路线转换为点列表(每 3 米)。 有可能 GMap.Net 吗?
是的。我使用点列表 (LatLng) 并且列出了完整的点列表。
''Create my route
Dim sta As New PointLatLng(TextBox1.Text, TextBox2.Text)
Dim sto As New PointLatLng(TextBox4.Text, TextBox3.Text)
Dim route As MapRoute = GMapProviders.OpenStreetMap.GetRoute(sta, sto, False, False, 13)
Dim rs As New GMapRoute(route.Points, "Route1")
Dim iOvrL As New GMapOverlay
iOvrL.Routes.Add(rs)
GMapa.Overlays.Add(iOvrL)
''GET POINTS
For Each point As PointLatLng In rs.Points
Dim pointx As String = point.Lat.ToString()
Dim pointy As String = point.Lng.ToString()
Next