0

In OpenLayers ol.source.ImageVector has been deprecated since v5.
Docs recommended to use an ol.layer.Vector with renderMode: 'image' instead.
But what if I want to get an another raster source at output? (Not a layer)
Is there any workaround?

Dmitriy Korobkov
  • 867
  • 1
  • 11
  • 25

1 Answers1

1

The output from ol.source.Raster is always a raster source. The input can be either a source or layer.

OpenLayers 4:

https://codepen.io/mike-000/pen/KKpgrmx

new ol.source.Raster({
  sources: [
    new ol.source.ImageVector({
      source: new ol.source.Vector()
    })
  ]
})

OpenLayers 5:

new ol.source.Raster({
  sources: [
    new ol.layer.Vector({
      source: new ol.source.Vector()
    }),
    renderMode: 'image'
  ]
})

OpenLayers 6:

https://codepen.io/mike-000/pen/BaNLvyq

new ol.source.Raster({
  sources: [
    new ol.layer.VectorImage({
      source: new ol.source.Vector()
    })
  ]
})
Mike
  • 16,042
  • 2
  • 14
  • 30