The OpenLayers.Layer.Vector subclass has many methods to manipulate data and to add interactivity to the features, the layer and the map itself. Let's work with some of them. In the following paragraphs we will try to explain how to add some features programmatically using some methods of the vector layer class.

As I stated before, The Vector class makes use of the Feature class to show objects on the layer. And in turn for the Feature class to work, it needs to use the Geometry class to create geometry objects. The Feature.Vector class uses the Geometry class to store geometry information (i.e., it stores geographic information) about a feature.

If you have some knowledge of GIS you will have worked with points, polygons, linear rings, lines or paths,... All these 'things' are usually called geometries in the GIS world. OpenLayers has several subclasses that inherit from the OpenLayers.Geometry class to define geometries. For example, to create a Point you can use the following javascript code, **new OpenLayers.Geometry.Point(20, 40);** , i.e., a point at the coordinate 20, 40.