0

I am using a SceneView and SceneLayer with the ArcGIS Javascript API 4.5. My SceneLayer has point features and I want to display them as cones with the point of the cone pointing to the ground. I can get them to render as cones with this renderer:

var renderer = {
    type: 'simple',  // autocasts as new SimpleRenderer()
    symbol: {  // symbol type required for rendering point geometries
        type: 'point-3d',  // autocasts as new PointSymbol3D()
        symbolLayers: [{  // renders points as volumetric objects
            type: 'object',  // autocasts as new ObjectSymbol3DLayer()
            resource: { primitive: 'cone' },  // renders points as cones
            width: 15
        }]
    }
};

However the cones are pointing the wrong direction and I can't find a good example of how to rotate them. Does anyone have any examples of this?

I would also like these points to scale based on zoom. I know that scale-based symbol sizing can be done for a map view but I haven't found how to do this with a scene view. Is this possible?

1 Answer 1

1

You don't need to rotate that cone, just use inverted-cone https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#resource

if you really want to rotate that 3D object, add tilt:180 in symbolLayers property https://developers.arcgis.com/javascript/latest/api-reference/esri-symbols-ObjectSymbol3DLayer.html#properties-summary

3
  • Thanks inverted-cone makes it easy. Any thoughts on the second part of my question about changing the size of the cone based on scale or zoom?
    – Chris
    Commented Nov 1, 2017 at 17:17
  • there is an example (// scale-dependent size) containing expression: "view.scale", in my last link above, that could help. Otherwise, you could make it programatically, with a few math on the dimensions of the cone relative to the scale...
    – LMokrane
    Commented Nov 1, 2017 at 17:42
  • expression is deprecated in 4.5 and viewExpression: '$view.scale' only works for MapViews. However, I did find this link with an example of changing the renderer every time the map zooms: community.esri.com/message/… That does what I want.
    – Chris
    Commented Nov 1, 2017 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.