How the Vector Layer works
There are primarily four things we need to cover to understand how the vector layer works.
How the Vector Layer is rendered
The Vector Layer class itself
The Geometry and Feature classes
How to use the related Strategy, Protocol, and Format classes
Let's go over rendering—fortunately, there's not much to it.
How the Vector Layer is rendered
As we discussed earlier, the vector layer doesn't use raster graphics. Other layer types use the <img>
tag (image tag) to show images—in HTML, the image tag will only display raster images. So, we can't just use <img>
tags like other layers. Instead, we have to use a vector image renderer. As we mentioned before, the vector data is not just an image, and can contain additional information such as the coordinates of the data.
The vector data must be rendered to be seen. OpenLayers supports three ways to render the vector layer: SVG, Canvas, and VML.
SVG
The default way to render the vector layer is to use the SVG renderer,...