[OpenLayers-Users] working with features

ulao S_K_U_N_X at yahoo.com
Fri Jul 16 09:29:47 EDT 2010


Here is the code I'm using to create

	 var linearRing = new OpenLayers.Geometry.LinearRing(points);
	 var obj = new OpenLayers.Geometry.Polygon([linearRing]);
     var polygonFeature = new OpenLayers.Feature.Vector( obj );
	shapeLayer.addFeatures(polygonFeature)
	return polygonFeature;

All I really need is a way to get and set very common data. For example lat
and lon position. If I try to use the Properties from JS I see most of them
are null? So this must not actually be Properties. Secondly if I trace a
function like createMarker the entire function is "return null;" So my guess
is the API is not complete. Surly there is a way to get and set the
position. Making  a feature work like a marker would be ideal as it seems
the marker class is complete.

I have been able to modify the style property, but generally speaking this
should be done via a function. The weird thing here is that I can create a
red shape, change it to blue just fine. Create another but this time I can
not change the color. 

It looks like the id property is working fine, is there a getById class that
has access to object control?



-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/working-with-features-tp5301904p5301904.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list