There are a few ways. If you just want to show a route, set the WebMapViewer.Mode to Directions, then use WebMapViewer.AddLocation to add some route waypoints (at least two).
In View mode it works the same, but you’ll have to call WebMapViewer.DrawRoute.
You don’t really need to pass any GeoJSON unless you want to pre-compute directions and store them into a database, to save a few calls to the routing service API. In that case, as @MarkusR mentioned, you have the WebMapViewer.Route method, that will return a MapRoute object, containing the raw GeoJSON data.
ok, i have try this code but the map show only first location (location)
and not the route
LocationMap.Zoom=18
Var location As New WebMapLocation
location.Address = “Via Ticino 10 agliana 51031 pistoia”
LocationMap.AddLocation(location)
LocationMap.GoToLocation(Location)
Var location1 As New WebMapLocation
location1.Address = “Via Ticino 30 agliana 51031 pistoia”
LocationMap.AddLocation(location1)
Var location2 As New WebMapLocation
location2.Address = “Via Ticino 40 agliana 51031 pistoia”
LocationMap.AddLocation(location2)
Var location3 As New WebMapLocation
location3.Address = “Via Ticino 73 agliana 51031 pistoia”
LocationMap.AddLocation(location3)
Var r As New MapRoute
r.TransportType=MapRoute.TransportTypes.Car
LocationMap.Mode=WebMapViewer.Modes.Directions
r=LocationMap.Route
LocationMap.DrawRoute(r)
then, is there an exaustive example of all possibilities for use this component? because the documentation is not exaustive and the example show only add location