This project is read-only.

Draw route and route animations...

Nov 19, 2009 at 4:53 PM
Edited Nov 20, 2009 at 2:45 AM

Hi there,

I wonder if anyone can show me how to draw routes as well as implement route animations provided the location info has already been available. For example: I have the coordinates of the detail route trails (points) of some vehicles and then I need to redraw (step by step: animations) those history route trails on the map. Thank you very much.


Trung Hoang

Nov 19, 2009 at 7:40 PM
Edited Nov 19, 2009 at 7:55 PM
You can for example:
In a routing panel will be available.
void OnRouteCalculated(object sender, EventArgs e)
RouteResultArgs args = (RouteResultArgs)e;
if (args == null)
DeepEarth.Client.Services.Bing.VERouteService.RoutePath path = args.Result.RoutePath;
GisSharpBlog.NetTopologySuite.Geometries.Coordinate[] coordinates = new
for (int i = 0; i < path.Points.Count; i++)
coordinates[i] = new GisSharpBlog.NetTopologySuite.Geometries.Coordinate(
path.Points[i].Longitude, path.Points[i].Latitude);
EditGeometry editGeom = new EditGeometry();
editGeom.MapInstance = MapInstance;
GisSharpBlog.NetTopologySuite.Geometries.LineString ls = new GisSharpBlog.NetTopologySuite.Geometries.LineString(coordinates);
var selectGeom = new SelectGeometry(ls, styles["style 1"], MapInstance);
RenderGeometry(selectGeom.Geometry, "style 1", routeLayer);
LocationRect locationRect = new LocationRect(
new Microsoft.Maps.MapControl.Location(args.Result.Summary.BoundingRectangle.Northeast.Latitude, args.Result.Summary.BoundingRectangle.Northeast.Longitude),
new Microsoft.Maps.MapControl.Location(args.Result.Summary.BoundingRectangle.Southwest.Latitude, args.Result.Summary.BoundingRectangle.Southwest.Longitude)
public SelectGeometry CurrentGeometry { get; set; }
void RenderGeometry(GeoAPI.Geometries.IGeometry geometry, string styleID, EnhancedMapLayer layer)
CurrentGeometry = new SelectGeometry(geometry, styles[styleID], MapInstance);
Nov 20, 2009 at 5:44 AM

Dear perf!

Could you explain a little bit more about this - steps do to when I have a list of coordinates (points)? because I am absolutely new to this control. I guess that what you mean is the routing panel is not available at the moment, right? so I have to wait... By the way, when i look at here . I wonder whether what you mean in the code is to use geocode to look for the right location of street for my each of the location info (GPS coordinate of points) then can render it on the routing panel?  

Thank you very much.



Nov 24, 2009 at 11:00 PM

Middlevn. There is a directionpanel available now in the source under Client/Controls/DeepEarth.Client.Controls.DirectionPanel.