Sometimes a tiled layer, such as Bing Maps, OpenStreetMap, or from WMS services, is not what you need. You may have access to a georeferenced image or know of a server that can return an image for arbitrary extents and resolutions.
In these cases, OpenLayers offers the ol.layer.Image
class that allows us to create a layer that is based on an image. For this recipe, we hook up to a WMS service that returns a single image on request for a given bounding box. The source code can be found in ch02/ch02-image-layer/
.
This recipe will use the ol.source.ImageWMS
source class to connect to the WMS server. However, if you have a static georeferenced image, then you should use ol.source.ImageStatic
, which works in much the same way.
