how can i draw 2 lines with different color i have example but only work in 1 way.. green or red but can't see both lines<div>if i comment line_orig -> green i can see the line_dest -> red ... and reverse.. but can't see the 2 lines</div>
<div>any idea?<br><div><br></div><div><div><html><body></div><div> <div id="mapdiv"></div></div><div> <script src="./OpenLayers/OpenLayers.js"></script></div><div>
<script></div><div> map = new OpenLayers.Map("mapdiv");</div><div> map.addLayer(new OpenLayers.Layer.OSM());</div><div> var lonLat = new OpenLayers.LonLat( -66.202700, 31.275800 )</div><div> .transform(</div>
<div> new OpenLayers.Projection("EPSG:4326"),</div><div> map.getProjectionObject()</div><div> );</div><div> var zoom = 6;</div><div> var player=new OpenLayers.Layer.Vector("Player",</div>
<div> {</div><div> styleMap: new OpenLayers.StyleMap({</div><div> "default": {</div><div> externalGraphic: "./images/airplane.gif",</div><div> graphicWidth: 28,</div><div>
graphicHeight: 28,</div><div> graphicYOffset: 0,</div><div> rotation: "${angle}",</div><div> fillOpacity: "${opacity}"</div><div> }</div><div> })</div><div>
});</div><div> var vectorLayer = new OpenLayers.Layer.Vector("Vector Layer");</div><div> var style_green =</div><div> {</div><div> strokeColor: "#00FF00",</div><div> strokeOpacity: 0.7,</div>
<div> strokeWidth: 2</div><div> };</div><div> </div><div> var style_red =</div><div> {</div><div> strokeColor: "#FF0000",</div><div> strokeOpacity: 0.7,</div><div> strokeWidth: 2</div>
<div> };</div><div><br></div><div> var line_orig = [];</div><div> var point_orig = new OpenLayers.Geometry.Point(-3.560945, 40.472225);</div><div> var point_plane = new OpenLayers.Geometry.Point(-66.202700, 31.275800);</div>
<div> </div><div> var line_dest = [];</div><div> var point_plane = new OpenLayers.Geometry.Point(-66.202700, 31.275800);</div><div> var point_dest = new OpenLayers.Geometry.Point(-82.409164, 22.988609);</div>
<div>
<br></div><div> line_orig.push(point_orig);</div><div> line_orig.push(point_plane);</div><div> var lineString_orig = new OpenLayers.Geometry.LineString(line_orig);</div><div><br></div><div> line_dest.push(point_plane);</div>
<div> line_dest.push(point_dest);</div><div> var lineString_dest = new OpenLayers.Geometry.LineString(line_dest);</div><div> </div><div> lineString_orig.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); </div>
<div> lineString_dest.transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()); </div><div> var lineFeature_green = new OpenLayers.Feature.Vector(lineString_orig, null, style_green);</div>
<div> var lineFeature_red = new OpenLayers.Feature.Vector(lineString_dest, null, style_red);</div><div> </div><div> vectorLayer.addFeatures([lineFeature_green, lineFeature_red]);</div><div> </div><div> map.addLayer(vectorLayer);</div>
<div><br></div><div> var feature=new OpenLayers.Feature.Vector(</div><div> new OpenLayers.Geometry.Point( lonLat.lon, lonLat.lat), {"angle": 242, opacity: 100});</div><div> player.addFeatures([feature]);</div>
<div> map.addLayer(player);</div><div><br></div><div> </div><div> map.setCenter (lonLat, zoom);</div><div> </script></div><div></body></html></div><div><br></div><div><br></div>-- <br><font color="#888888"><font color="#888888">Antonio Pe</font><span><font color="#888888">ñ</font></span><font color="#888888">a</font><span></span><br>
<font color="#888888">Secure email with PGP 0x8B021001 available at <a href="http://pgp.mit.edu" target="_blank">http://pgp.mit.edu</a><br></font></font><font color="#888888">
<font color="#888888">Fingerprint: 74E6 2974 B090 366D CE71 7BB2 6476 FA09 8B02 1001</font></font><br>
</div></div>