HI!!
i need assign data to a segmet (painted with vector class), so when i click
on it return to me the assigned data .... can you help me please?
this is my code.
var linea_style = OpenLayers.Util.extend({},
OpenLayers.Feature.Vector.style['default']);
linea_style.strokeWidth = 6;
linea_style.strokeColor = "#ff0000";
linea_style.strokeOpacity = 0.5;
var linea_style20 = OpenLayers.Util.extend({},
OpenLayers.Feature.Vector.style['default']);
linea_style.strokeWidth = 7;
linea_style.strokeColor = "blue";
linea_style.strokeOpacity = 0.5;
result_linea = new OpenLayers.Layer.Vector(
"Routing results",
{style: linea_style});
map.addLayer(result_linea);
features=[a lot of segment];
result_linea.addFeatures(features);
var options= new OpenLayers.Control.SelectFeature(result_linea, {
hover: false,
highlightOnly: true,
clickout:true,
onSelect: function(feature) {
//alert(feature);
for (var us in feature ){
//campo va tomando los nombres de las
propiedades
alert( feature[us] );
}
},
selectStyle: linea_style2
});
map.addControl(options);
options.activate();
that part I can assign the data?
RG
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users