If you remember the description of layers, two main layers types are vector and raster. Some layers with specific
ol.source accept methods to access geographic features in your map. The map queries each of the specified layers for this information, but not all layers support this. Only layers that support querying for geographic features will return results.
Without going deep into explanation, think that for the vector, you are querying the features near the point where you've done the click. Whereas for raster, you ask a remote resource to get a position on the image and extrapolate from this position the features of the image.
We will first review how to work with a vector source and then with ...