How to Set the rotation info on the stream service using the renderer

3339
6
04-13-2016 03:33 AM
kishorekumar1
New Contributor II

Hi,

     I have a stream service which has a particular field which represents the angle(heading) of the feature. Now, I want to use that field values as the rotation angle for all the stream service features using the renderer. In 3.15 javascript version there is a method setRotationInfo() in Class SimpleRederer but this method is missing in 4.0 JavaScript beta. So, how can I set the rotation info for the renderer so that it can be levied on the stream service.

Regards,

Kishore Kumar

Tags (1)
6 Replies
DavidBlanchard
Esri Contributor

I believe this isn't available yet in the 4.0 API beta. By digging around the objects, the Rotation Info object is still present in the renderer as it was before, but isn't documented and probably isn't implemented or ready for prime-time. It should show up in one of the future releases, keep an eye on our blog for when it does.

(Disclaimer, I don't work for the API team)

0 Kudos
KristianEkenes
Esri Regular Contributor

The rotation visual variable will be available in 4.0 final so you should be able to do something like this:

var rotRenderer = new SimpleRenderer({
  symbol: picSym,
  visualVariables: [{
    type: "rotation",
    field: "heading",
    rotationType: "geographic"
  }]
});

var streamLayer = new StreamLayer({
  url: svcUrl,
  renderer: rotRenderer,
});
kishorekumar1
New Contributor II

Hi Kristian,

                    Now, I am using latest release of ArcGIS api for javascript 4.0.Using the above rotation code I have achieved the rotation of the features of the stream service in 2D view.But I failed to achieve this on the scene view.Please guide me in this regard.

0 Kudos
KristianEkenes
Esri Regular Contributor

Rotation is not supported in SceneView for 4.0. We're discussing plans for support in a future release.

KrishV
by
Occasional Contributor III

is this supported in current version. If yes, please help me with code snippet how to achieve rotation in Scene View for Stream Service.

I'm trying to rotate picture marker symbol for Stream Service.

Thanks,

Krish

0 Kudos
KristianEkenes
Esri Regular Contributor

SceneView supports rotation if a symbol contains an ObjectSymbol3DLayer is used, so PictureMarkerSymbols aren't supported. The documentation states the following limitations:

In a SceneView rotation visual variables are not supported with marker symbols, text symbols, 3D icon symbol layers and 3D text symbol layers.

Renderer | API Reference | ArcGIS API for JavaScript 4.5