Loading data from an external source is not the only way to work with vector layers.
Imagine a web mapping application where the user can create new features on the fly: cities, rivers, areas of interest, and so on, and add them to a vector layer with some style. This scenario requires the ability to create and add the features programmatically.
In this recipe we will see some ways to create and manage features programmatically.
divelement to hold the map:
<!-- Map DOM element --> <div id="ch3_features_programmatically" style="width: 100%; height: 100%;"></div>