(Not Signed In)

Sign In

.NET Development: Drawing Line(s), Polygon(s), Circle(s)

Bottom of Page

1 to 6 of 6

  1.  
  1.  
    Hi:

    Is somebody there to help me out for above. Some sample codes would be greatly appreciated

    Thanks
    •  
      CommentAuthorPepitaL
    • CommentTimeJan 25th 2010
     
    Have you looked at the "Renderer Walk-Through" in the GeoBase documentation? It shows how to add a point to the map, but the concept is the same, since it allows you how to ensure drawing you've done stays with the map as it moves.
    • CommentAuthorwpearse
    • CommentTimeJan 25th 2010 edited
     
    Hey Lino,

    As Pepita says, you're probably wanting to create your own renderer. Some other options are:

    1) If you're using SilverStream/Silverlight there's a tutorial that shows you how to draw all sorts of shapes:
    http://geozone.geobase.info/resources/view/drawing-on-a-silverstream-map

    2) Alternatively, what about using a Telogis.GeoBase.Scribble object and adding points to represent a line/rectangle/circle etc?

    /William
  2.  
    Thanks a lot !

    I tried renderlist and reached somewhere, but still I am not able to draw the line unless there is street data available. Below is the sample code. Actually I dont need street data as my plan is to draw flight routes, basically from one waypoint to another.

    I have seen some class for Line and LineString, Could you please give me some samples on how to use the same...

    ***********
    RouteStop[] myRoute = new RouteStop[]
    {
    new RouteStop(new LatLon(8,77)),
    new RouteStop (new LatLon(55,77))
    };
    Route Route1 = new Route(myRoute[0], myRoute[1]);
    //Directions myDirection = Route1.GetDirections();
    //myDirection.RenderColor = Color.Green;
    RendererList renderer = new RendererList();
    myRoute[0].RenderBrush = new SolidBrush(Color.Green);
    myRoute[1].RenderBrush = new SolidBrush(Color.Beige);
    mapCtrl1.Renderer = renderer;
    renderer.AddRange(myRoute);
    //renderer.Add(myDirection);
    mapCtrl1.Invalidate();

    ******

    Thanks!
    • CommentAuthorwpearse
    • CommentTimeJan 28th 2010
     
    Hey Lino,

    Routes are drawn along roads - so I don't think this is what you want for your flight routes. Line and LineString are used for geometries and (I don't think) they're what you want.

    Instead, (as I mentioned earlier) check out the Scribble class (I think it's Telogis.GeoBase.Scribble). A scribble is a bunch of arbitrary lines drawn between given points. Here's an example of how you'd use a scribble (I'm typing this on my Mac so I can't check for syntax errors or that it compiles, but you should get the idea).

    ------

    Scribble s = new Scribble();
    s.Pen = new Pen(Color.Red, 5); // draw the lines in red, 5 pixels thick. If this doesn't work try s.Brush?

    s.AddPoint(new LatLon(8, 77)); // first waypoint
    s.AddPoint(new LatLon(55, 77)); // second waypoint
    // add more waypoints if you want...

    myMapControl.Renderer = s; // draw the scribble on the map

    ------

    Let me know how this works out...

    Cheers,
    Will
  3.  
    Thanks a lot Will !

    That worked out...
    It is,
    s.RenderPen = new Pen(Color.Red, 5);

    Rgds,
    Lino

1 to 6 of 6

  1.