Evaldas,<br><br>This works for me.<br><br>On Canvas.js I have added:<br><br> addPolyLine: function(points) {<br> var ctx = this.canvas.getContext("2d");<br><br> ctx.beginPath();<br><br> var k = 0;
<br> for (k=0; k<points.length; k++)<br> {<br> var px = this.map.getPixelFromLonLat(points[k]);<br><br> if (k==0)<br> {<br> ctx.moveTo(px.x, px.y);<br> }
<br> else<br> {<br> ctx.lineTo(px.x, px.y);<br> }<br> }<br><br> ctx.stroke();<br> },<br><br> drawPolyLine: function(points) {<br> var ctx = this.canvas.getContext
("2d");<br> this.addPolyLine(points);<br> this.lines.push(new Array(points, ctx.strokeStyle, ctx.lineWidth, ctx.globalAlpha));<br> },<br><br>And changed on redraw()<br><br> for(var i=0; i <
this.lines.length; i++) {<br> if (this.lines[i].length==4)<br> {<br> this.setStrokeColor(this.lines[i][1]);<br> this.setStrokeWidth(this.lines[i][2]);<br>
this.setAlpha(this.lines[i][3]);<br> this.addPolyLine(this.lines[i][0]);<br> }<br> else<br> {<br> this.setStrokeColor(this.lines[i][2]);<br> this.setStrokeWidth
(this.lines[i][3]);<br> this.setAlpha(this.lines[i][4]);<br> this.addLine(this.lines[i][0], this.lines[i][1]);<br> }<br> } <br><br>Best Regards,<br><br>Fred<br><br><div><span class="gmail_quote">
On 1/31/07, <b class="gmail_sendername">Evaldas Taroza</b> <<a href="mailto:e.taroza@gmail.com">e.taroza@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I have lost the track on the progress of OpenLayers. Can one already draw a polyline on the map?<br><br>Thanks,<br><br>Zeppe<br>
<br>_______________________________________________<br>Users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://openlayers.org/mailman/listinfo/users" target="_blank">
http://openlayers.org/mailman/listinfo/users</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>"Everything under the sun is in tune<br>But the sun is eclipsed by the moon"