Hi, Go to http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/draw-feature.html and open your js debugger The code below makes the job for example
//Because a closure, I get the vector point layer indirectly var pointLayer = map.layers[1]; //Declare the new feature var newFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(5, 5), { 'key1': 'abcdef', 'key2': 'ghijkl' } ) pointLayer.addFeatures([newFeature]); // Enjoy (tested in Firefox and Google Chrome) // This code above comes mainly from this old tutorial (good enough to get started with OpenLayers 2.x version) http://docs.openlayers.org/library/introduction.html#adding-a-vector-marker-to-the-map // You might consider more recent docs too http://workshops.boundlessgeo.com/openlayers-intro/ As a reminder, before asking, consider searching. OpenLayers v 2.x is really documented everywhere and since a long time. Cheers Thomas
_______________________________________________ Users mailing list us...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users