openlayers / ol-cesium

OpenLayers - Cesium integration

Home Page:http://openlayers.org/ol-cesium/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with Open Layers Draw

bbehling-trimble opened this issue · comments

Trying to use OL Draw, two issues I noticed so far.

  1. If the 3D cesium map is enabled, the draw 'tools' do not load (highlighted point on mouse cursor, polygon border lines), interactions are not added to the map.
  2. If the Cesium map is not enabled, draw a polygon, then enable the Cesium map. The drawn feature is not placed on the map correctly. The polygon does not stay in place when navigating the map.

Can we draw in 3D mode and can the position of the drawn vector be placed on the map correctly?

At the moment there is no support for interactions in 3d.

  1. interactions are removed from the OL map when 3d is enabled;
  2. I think setting layer.set('altitudeMode', 'clampToGround') on your layer would fix this.

Hi.

Could I make a pull request and try to add 3d map interactions?

layer.set('altitudeMode', 'clampToGround') works for clamping to ground.

Can you explain what the set function does? Is this the ol-cesium preferred method of adding Cesium specific properties to to objects?

Sure @bbehling-trimble, if you can come up with a PR I will look at it.

The OpenLayers set method is setting some properties on the object. Then OL-Cesium check these properties to know how to create the Cesium counterpart for the object.

We too are facing issues with the vector features not reflecting on Cesium like how it used to happen earlier.
Is this a bug or deprecation

@SCKgithub I was able to draw a feature in 2D mode. When I switched to 3D mode and loaded the Cesium viewer, the polygon was visible and clamped to the terrain. Are you saying you were able to draw in 3D mode at some earlier point?

@SCKgithub I noticed in native Cesium there are issues with KMLs clamping to terrain.

@SCKgithub Well, keep in mind that olcesium uses native Cesium behind the scenes. The version of olcesium you are using, could be implementing a version of native Cesium that contains a KML bug.

https://github.com/AnalyticalGraphicsInc/cesium/issues/873

With overlaying vectors, I just followed the OL draw tools example. I drew a polygon in 2D mode, then switched to 3D mode and the drawn vector overlaid without an issue.

I haven't tried adding vectors without the drawing tools though.

https://openlayers.org/en/latest/examples/draw-features.html

Hello, I want to ask you a question: because cesium can load models and implement movements such as airplane flight. Can olcesium achieve the same functionality?Thank you very much!

@kk1625846601, OL-Cesium is just a wrapper around OpenLayers and Cesium. You can get the Cesium scene using https://github.com/openlayers/ol-cesium/blob/master/src/olcs/OLCesium.js#L461and then use any functionality from Cesium.

@gberaudo Excuse me, my boss asks me to realize the function of flight by using olcesium now, but I still have no idea about it. In cesium,this function needs clockViewModel ,clock and timeline which belong to viewer. In olcesium,I  try to create the three objects and add them to the map,but it doesn't work. Now how can I do by using the scene of olcesium? Thank you very very  much. 

@kk1625846601, you should open a new issue for unrelated discussions.

Do you mean https://cesium.com/docs/cesiumjs-ref-doc/Camera.html#flyTo ?