<?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 Re: Accessing Graphics on a Map in 4.0Beta in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106066#M9797</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That example returns graphics properties only in MapView&amp;nbsp; (and even then only .length is available... the geometry and attributes seem to be private and inaccessible)&lt;/P&gt;&lt;P&gt;I need to access map graphics in SceneView.&amp;nbsp; Is there ANY native way to do this?&amp;nbsp; Will a getter function be available in the official release?&lt;/P&gt;&lt;P&gt;using getCanvas3DGraphics() or something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd rather not hit the server with a query/identifyTask when the info from the featureclass is already on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var fLayerView;&lt;/P&gt;&lt;P&gt;view.on("layer-view-create", function(evt) { //unlike view.then, this fires as EACH layer is converted to a layerview&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (evt.layer.id === "myFeatureClassId") {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fLayerView = evt.layerView;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphics = fLayerView.getCanvas3DGraphics();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphics.forEach(function(item, i){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(item+", "+i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //get attributes for custom mouse-over events or custom search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Mar 2016 18:00:53 GMT</pubDate>
    <dc:creator>lanceweaver</dc:creator>
    <dc:date>2016-03-01T18:00:53Z</dc:date>
    <item>
      <title>Accessing Graphics on a Map in 4.0Beta</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106063#M9794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I can't seem to access the graphics on the Map in 4.0Beta.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;In the documentation, it says graphics are no longer stored in 'map' or 'featureLayer', but "&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;as graphics inside a &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/beta/api-reference/esri-views-layers-LayerView.html" style="color: #0079c1; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;LayerView&lt;/A&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;But I can't seem to get &lt;A href="https://developers.arcgis.com/javascript/beta/api-reference/esri-views-View.html#getLayerView" style="color: #005e95; text-decoration: underline; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 17px;"&gt;View.getLayerView()&lt;/A&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt; or any other construct to work in order to access the graphics in my featureLayer loaded from Arc Server.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; font-size: 12pt; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif;"&gt;I don't even see them in the console under console.log(view.layerViews.item[]...)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4c4c4c; font-family: 'Avenir Next W01', 'Avenir Next W00', 'Avenir Next', Avenir, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12pt;"&gt;Can someone show me just a simple example of how to access the graphics on a map?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 15:02:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106063#M9794</guid>
      <dc:creator>lanceweaver</dc:creator>
      <dc:date>2016-02-26T15:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Graphics on a Map in 4.0Beta</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106064#M9795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to clarify, I'm hoping to loop through the graphics to modify them (like the old API did with "map.graphics", perhaps with something like this....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var mapgraphics = view.getLayerView(myFeatureLayer);&lt;/P&gt;&lt;P&gt;dojo.forEach(mapgraphics, function(g){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //console.log(g);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (g.attributes.pub_title == var"){ change style };&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now I can't even find a way to access graphics when clicking them ---like the old&lt;/P&gt;&lt;P&gt;view.on("click", function(evt) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; graphic = evt.graphic&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help please...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 15:14:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106064#M9795</guid>
      <dc:creator>lanceweaver</dc:creator>
      <dc:date>2016-02-26T15:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Graphics on a Map in 4.0Beta</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106065#M9796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is a sample showing how to get the graphics with a LayerView.&lt;/P&gt;&lt;P&gt;&lt;A href="http://jsbin.com/perovey/8/edit?js,output" title="http://jsbin.com/perovey/8/edit?js,output"&gt;JS Bin - Collaborative JavaScript Debugging&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think you can style the graphic in place though, you may need to use graphic.clone() and apply a new symbol and add it to the map.graphics layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2016 17:55:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106065#M9796</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2016-02-26T17:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing Graphics on a Map in 4.0Beta</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106066#M9797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That example returns graphics properties only in MapView&amp;nbsp; (and even then only .length is available... the geometry and attributes seem to be private and inaccessible)&lt;/P&gt;&lt;P&gt;I need to access map graphics in SceneView.&amp;nbsp; Is there ANY native way to do this?&amp;nbsp; Will a getter function be available in the official release?&lt;/P&gt;&lt;P&gt;using getCanvas3DGraphics() or something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd rather not hit the server with a query/identifyTask when the info from the featureclass is already on the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var fLayerView;&lt;/P&gt;&lt;P&gt;view.on("layer-view-create", function(evt) { //unlike view.then, this fires as EACH layer is converted to a layerview&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (evt.layer.id === "myFeatureClassId") {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fLayerView = evt.layerView;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphics = fLayerView.getCanvas3DGraphics();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphics.forEach(function(item, i){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(item+", "+i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //get attributes for custom mouse-over events or custom search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2016 18:00:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/accessing-graphics-on-a-map-in-4-0beta/m-p/106066#M9797</guid>
      <dc:creator>lanceweaver</dc:creator>
      <dc:date>2016-03-01T18:00:53Z</dc:date>
    </item>
  </channel>
</rss>

