<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Change symbolLayer in place without having to recreate it in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-symbollayer-in-place-without-having-to/m-p/1268353#M80573</link>
    <description>&lt;P&gt;Hi, I am building an application where I need to update my 3D model of a drone several times per second. For the drone model I add a Graphic to a GraphicsLayer with a PointSymbol3D having a ObjectSymbol3DLayer that has the drone model. The code for creating this graphic is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;const point = new Point({&lt;BR /&gt;spatialReference: SPATIAL_REFERENCE,&lt;BR /&gt;latitude: telemetry.latitude,&lt;BR /&gt;longitude: telemetry.longitude,&lt;BR /&gt;hasZ: true,&lt;BR /&gt;z: telemetry.relativeAltitude,&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;const symbolLayer = new ObjectSymbol3DLayer({&lt;BR /&gt;height: 1,&lt;BR /&gt;anchor: 'relative',&lt;BR /&gt;anchorPosition: {&lt;BR /&gt;x: 0,&lt;BR /&gt;y: 0,&lt;BR /&gt;z: -0.2,&lt;BR /&gt;},&lt;BR /&gt;resource: {&lt;BR /&gt;href: './drone3D.glb'&lt;BR /&gt;},&lt;BR /&gt;heading: telemetry.heading + 180,&lt;BR /&gt;tilt: telemetry.pitch,&lt;BR /&gt;roll: telemetry.roll,&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;const symbol = new PointSymbol3D({&lt;BR /&gt;symbolLayers: [&lt;BR /&gt;symbolLayer&lt;BR /&gt;]&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;droneModel = new Graphic({&lt;BR /&gt;geometry: point,&lt;BR /&gt;symbol,&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;droneModelLayer.add(droneModel)&lt;BR /&gt;focusDrone()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Since I need to do this kind of operation several times per second, I don't want to make a new ObjectSymbol3DLayer everytime, but I would rather like modifying its properties in-place. More exactly I just need to modify the tilt, heading and roll of the ObjectSymbol3DLayer. I've tried many ways to do this, but can't make it work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;const symbolLayer = ((droneModel.symbol as PointSymbol3D).get('symbolLayers') as any)[0]&lt;BR /&gt;symbolLayer.set({&lt;BR /&gt;heading: telemetry.heading + 180,&lt;BR /&gt;tilt: telemetry.pitch,&lt;BR /&gt;roll: telemetry.roll&lt;BR /&gt;})&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Wed, 15 Mar 2023 23:11:41 GMT</pubDate>
    <dc:creator>JPichel</dc:creator>
    <dc:date>2023-03-15T23:11:41Z</dc:date>
    <item>
      <title>Change symbolLayer in place without having to recreate it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-symbollayer-in-place-without-having-to/m-p/1268353#M80573</link>
      <description>&lt;P&gt;Hi, I am building an application where I need to update my 3D model of a drone several times per second. For the drone model I add a Graphic to a GraphicsLayer with a PointSymbol3D having a ObjectSymbol3DLayer that has the drone model. The code for creating this graphic is this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;const point = new Point({&lt;BR /&gt;spatialReference: SPATIAL_REFERENCE,&lt;BR /&gt;latitude: telemetry.latitude,&lt;BR /&gt;longitude: telemetry.longitude,&lt;BR /&gt;hasZ: true,&lt;BR /&gt;z: telemetry.relativeAltitude,&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;const symbolLayer = new ObjectSymbol3DLayer({&lt;BR /&gt;height: 1,&lt;BR /&gt;anchor: 'relative',&lt;BR /&gt;anchorPosition: {&lt;BR /&gt;x: 0,&lt;BR /&gt;y: 0,&lt;BR /&gt;z: -0.2,&lt;BR /&gt;},&lt;BR /&gt;resource: {&lt;BR /&gt;href: './drone3D.glb'&lt;BR /&gt;},&lt;BR /&gt;heading: telemetry.heading + 180,&lt;BR /&gt;tilt: telemetry.pitch,&lt;BR /&gt;roll: telemetry.roll,&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;const symbol = new PointSymbol3D({&lt;BR /&gt;symbolLayers: [&lt;BR /&gt;symbolLayer&lt;BR /&gt;]&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;droneModel = new Graphic({&lt;BR /&gt;geometry: point,&lt;BR /&gt;symbol,&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;droneModelLayer.add(droneModel)&lt;BR /&gt;focusDrone()&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Since I need to do this kind of operation several times per second, I don't want to make a new ObjectSymbol3DLayer everytime, but I would rather like modifying its properties in-place. More exactly I just need to modify the tilt, heading and roll of the ObjectSymbol3DLayer. I've tried many ways to do this, but can't make it work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;const symbolLayer = ((droneModel.symbol as PointSymbol3D).get('symbolLayers') as any)[0]&lt;BR /&gt;symbolLayer.set({&lt;BR /&gt;heading: telemetry.heading + 180,&lt;BR /&gt;tilt: telemetry.pitch,&lt;BR /&gt;roll: telemetry.roll&lt;BR /&gt;})&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 15 Mar 2023 23:11:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/change-symbollayer-in-place-without-having-to/m-p/1268353#M80573</guid>
      <dc:creator>JPichel</dc:creator>
      <dc:date>2023-03-15T23:11:41Z</dc:date>
    </item>
  </channel>
</rss>

