Need help with LineStringFeature

37 views
Skip to first unread message

diego

unread,
Jan 25, 2012, 1:57:07 PM1/25/12
to openscales-dev
Hi all.

I need help with LineStringFeature. I'm trying to draw lines on a map,
but the line is not showing. I have followed the examples I've found
in this forum, but with no success. Could someone share a working
example?

TIA

Diego Marrero

Hermes David

unread,
Jan 27, 2012, 10:07:48 AM1/27/12
to openscales-dev
Hi,
the code below draws a line in NY. After your map loads fust zomm
there and you will see

var featureLayer:VectorLayer = new VectorLayer("Drawing");

var style:Style = new Style();
style.rules.push(new Rule());
style.rules[0].symbolizers.push(new LineSymbolizer(new
Stroke(0xFF0000,2)));

var points:Vector.<Number> = new Vector.<Number>();
points.push(-74.0061344408378);
points.push(40.7133534576121);
points.push(-74.0058367156372);
points.push(40.7137275408995);
points.push(-74.0056382321701);
points.push(40.7136380863915);


featureLayer.addFeature(new LineStringFeature(new
LineString(points),null,style));

fxmap.map.addLayer(featureLayer);


Hermes David
Reply all
Reply to author
Forward
0 new messages