openlayers / ol-cesium

OpenLayers - Cesium integration
http://openlayers.org/ol-cesium/
BSD 2-Clause "Simplified" License
1.01k stars 327 forks source link

ol/layer/vectorImage is not rendered in the 3d map #998

Open ridaboe opened 2 years ago

ridaboe commented 2 years ago

now that render mode: 'image' is deprecated , I am using VectorImageLayer to display vector layers with hundreds of features However this type of layer is not shown in the 3d map. will olcs support vectorImageLayer or is is there a property of ol/layer/vector that I can use instead of rendermode:'image'?

or4inveni commented 2 years ago

Dear @gberaudo! Do you have a hint how to fix it - how heavy is it to add the new VectorImage Type to the ol-cesium implementation? I could take care of it if it's not too big.

gberaudo commented 2 years ago

Hi @or4inveni, I think the easiest is to handle the VectorImage layer as a Vector layer.

In src/olcs/VectorSynchronizer.js, change the condition at the top of createSingleLayerCounterparts:

    if (!(olLayer instanceof olLayerVector) || olLayer instanceof olLayerVectorTile) {
      return null;
    }

->

    if (!(olLayer instanceof olLayerVector) || olLayer instanceof olLayerVectorTile || olLayer instanceof olLayerVectorImage) {
      return null;
    }

Then you should add a checkbox to the vector example so that it can be used both with Vector and VectorImage layers.

or4inveni commented 2 years ago

hi @gberaudo I quickly implemented your idea.

  1. as you know cesium 1.98.0 is breaking ol-cesium completely so I limited the dependency to cesium 1.97.0.
  2. There might be a better way and/or location to cast/change from olimagevector to olvector - please review it
  3. How long will it take to publish the fix into the npm package?
Screenshot 2022-10-24 at 11 30 36
gberaudo commented 1 year ago

Hi @or4inveni , in addition to your PR, there are some cleanup to do regaring ES6 exports. If PRs get ready soon, I can imagine a release next week.

or4inveni commented 1 year ago

Sorry for the long break. We expierenced a major memory leak - probably related to this solution attempt that's why i didn't follow it anymore. Could be also based on something different in ol-cesium - we have a lot of layers weren't 100% certain of the cause. But it came up after this version change.

gberaudo commented 1 year ago

Hi @or4inveni, I remember there was some memory leak fix a while ago. Have you checked recently?

songsgroup commented 8 months ago

I remember there was some memory leak fix a while ago. Have you checked recently?