Dynamically Add Polylines in Code

Jul 21, 2009 at 3:30 PM

I know you can dynamically add Markers using 

GoogleMap1.Markers.Add(new Artem.Web.UI.Controls.GoogleMarker(LATITUDE, LONGITUDE));

 

My question is I want to dynamically add Polylines connecting each of my markers, how would I accomplish this?

 

Thanks!

Jul 22, 2009 at 9:02 AM

 

 GooglePolyline gpl = new GooglePolyline();
        gpl.Color = System.Drawing.Color.Red;

 GoogleMap1.Polylines.Clear();

 GooglePolyline gpl = new GooglePolyline();

  gpl.Color = System.Drawing.Color.Red;

// you can make a loop here (from database for example)

{

 GoogleLocation gl = new GoogleLocation(YOURLONG, YOURLAT);

gpl.Points.Add(gl);

}

GoogleMap1.Polylines.Add(gpl);

 

 

hope it help

 

Aug 29, 2009 at 12:18 AM
Edited Aug 30, 2009 at 5:13 AM

I can't get the code from the previous post to work.  It will work if I put it in the markup code (.aspx) but not in the code behind.

I have the same problem with the GoogleCirclePolygon.

I have no problems doing markers in the code behind.

I have the vml xmlns linked in the html header.

Using Asp.net 2.0 with VS 2005 and the built in debug web server.

Any help would be appreciated.

Edit::

I got it to work based on the code in GoogleCirclePolygon.aspx.cs in the source codeI don't know what I was doing that was wrong before (?).

Thanks anyway.