Nirish,
As I know, it’s an issue of GDI+. A workaround is that we define the different lineStyle with Dot LineDashStyle. For instance, The width will be small for big zoom level, be larger for small zoom level. Here is the sample code you can try:
routeLayer = new InMemoryFeatureLayer();
GeoPen pen1 = new GeoPen(GeoColor.SimpleColors.Blue, 3);
pen1.LineDashStyle = LineDashStyle.Dot;
routeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = new LineStyle(pen1);
routeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level15;
GeoPen pen = new GeoPen(GeoColor.SimpleColors.Blue, 4);
pen.LineDashStyle = LineDashStyle.Dot;
routeLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle = new LineStyle(pen);
routeLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle.OuterPen.LineJoin = DrawingLineJoin.Round;
routeLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle.OuterPen.StartCap = GeoDashCap.Round;
routeLayer.ZoomLevelSet.ZoomLevel15.DefaultLineStyle.OuterPen.EndCap = GeoDashCap.Round;
routeLayer.ZoomLevelSet.ZoomLevel15.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay routeOverlay = new LayerOverlay();
routeOverlay.Layers.Add("routeLayer", routeLayer);
Map1.Overlays.Add("RouteOverlay", routeOverlay);
Also you can replace the installaion sample “GetShortestPathByCoordinates.xaml” with the attached, and then have a try.
Thanks,
Johnny
Samples.zip (2.31 KB)