Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all articles
Browse latest Browse all 3384

New Post: Adding my own points on a route

$
0
0
hi
when i draw the route with the function "routebetweenpoints" i need that the route croos over specifing points
i have 900 coordinates
here is my code :

Dim route As MapRoute = GMap.NET.MapProviders.GoogleMapProvider.Instance.GetRouteBetweenPoints(start, endStop, False, False, 15)
    route.Points.Clear()
    For i As Integer = 0 To listOfRoutes.Count - 1  
        Dim Coordinates As PointLatLng = New PointLatLng(listOfRoutes.Item(i).latitude, listOfRoutes.Item(i).longitude)
        route.Points.Add(Coordinates)

    Next

    Dim NewRoute As GMap.NET.WindowsForms.GMapOverlay

    NewRoute = New GMap.NET.WindowsForms.GMapOverlay(MainMap, "My Route")
    MainMap.Overlays.Add(NewRoute)
     Dim r As GMapRoute = New GMapRoute(route.Points, "My Route")
     r.IsVisible = True
    Dim routesOverlay As GMapOverlay = New GMapOverlay(MainMap, "routes")
    routesOverlay.Routes.Add(r)
    MainMap.Overlays.Add(routesOverlay)
    r.Stroke.Width = 3
    r.Stroke.Color = Color.GreenYellow
    MainMap.ZoomAndCenterRoute(route)
    MainMap.SelectedAreaFill.Dispose()
i got a blue screen with agriturismo sandrone


i also try this :
Dim listPointlatlon As New List(Of PointLatLng)
    For Each lst In listofRoute
        listPointlatlon.Add(New PointLatLng(lst.latitude, lst.longitude))
    Next
    Dim r As GMapRoute = New GMapRoute(listPointlatlon, "routes")
    r.Stroke.Width = 5
    r.Stroke.Color = Color.Blue
    Dim routesOverlay As GMapOverlay = New GMapOverlay(MainMap, "routes")

    routesOverlay.Routes.Add(r)
    MainMap.ZoomAndCenterRoute(r)

please help
thanks a lot

Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>