<?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 get and put graphic attribute on mouseclick of a particular overlay in ArcGIS AppStudio Questions</title>
    <link>https://community.esri.com/t5/arcgis-appstudio-questions/get-and-put-graphic-attribute-on-mouseclick-of-a/m-p/1021407#M3778</link>
    <description>&lt;P&gt;Hi i am trying to get graphic attribute on mouse click , below is my code. Kindly help.&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/204423" target="_blank" rel="noopener"&gt;@ErwinSoekianto&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to show username like the picture below it do not come from any feature layer but i have &lt;/P&gt;&lt;P&gt;to get it from private server to show, here on click&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-01-27 at 11.23.22 AM.png" style="width: 153px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4860iBB81C5B09BD0788E/image-dimensions/153x112?v=v2" width="153" height="112" role="button" title="Screenshot 2021-01-27 at 11.23.22 AM.png" alt="Screenshot 2021-01-27 at 11.23.22 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;so i tried like this and trying to get graphic- attribute or geometry, but it always come undefined, as i have to identify the graphic clicked and then get the username .&lt;/P&gt;&lt;PRE&gt;// *** declare mapview***//
    MapView {
        id:mapView
        property real initialMapRotation: 0
        Component.onCompleted: {
                mmpk.load();
            }
        anchors {
            left: parent.left
            right: parent.right
            top: parent.top
            bottom: parent.bottom
        }

        
        GraphicsOverlay{
            id:hunterfreindPathOverlay
        }
        //! [show callout qml api snippet]
        // initialize Callout
        calloutData {
            location: calloutLocation
            detail: "LINZ USER"
        }

        Callout {
            id: callout
            calloutData: parent.calloutData
            leaderPosition: leaderPositionEnum.Automatic
        }
        //! [show callout qml api snippet]

        // display callout on mouseClicked
        onMouseClicked: {
            const tolerance = 22;
            const returnPopupsOnly = false;
            const maximumResults = 1;

            if (callout.calloutVisible)
                callout.dismiss()
            else
            {             
       mapView.identifyGraphicsOverlayWithMaxResults(hunterfreindPathOverlay, mouse.x, mouse.y, tolerance, returnPopupsOnly, maximumResults);
                calloutLocation = mouse.mapPoint;
            }
        }
        // Signal handler for identify graphics overlay
            onIdentifyGraphicsOverlayStatusChanged: {
                if (identifyGraphicsOverlayStatus === Enums.TaskStatusCompleted) {
                    if (identifyGraphicsOverlayResult.graphics.length &amp;gt; 0) {
console.log("===&amp;gt;"+identifyGraphicsOverlayResult.graphics.geometry);
console.log("===&amp;gt;"+identifyGraphicsOverlayResult.graphics.attribute);
                        callout.accessoryButtonHidden = true;
                        callout.showCallout();
                    }
                } else if (identifyGraphicsOverlayStatus === Enums.TaskStatusErrored) {
                    console.log("error");
                }
            }
                //! [identify graphics api snippet]
    }//End Mapview&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;So i tried to add attribute like this and trying to fetch it, but unsuccessful&lt;/P&gt;&lt;PRE&gt;     // *** Create  graphic for boundaries and markers ***//
    function createGraphic(geometry, symbol) {
        var graphic = ArcGISRuntimeEnvironment.createObject("Graphic");
        graphic.geometry = geometry;
        graphic.symbol = symbol;
        graphic.attributes.insertAttribute("username", "LINZs");

        return graphic;
    }//end createGraphic&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2021 07:00:42 GMT</pubDate>
    <dc:creator>rsharma</dc:creator>
    <dc:date>2021-01-29T07:00:42Z</dc:date>
    <item>
      <title>get and put graphic attribute on mouseclick of a particular overlay</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/get-and-put-graphic-attribute-on-mouseclick-of-a/m-p/1021407#M3778</link>
      <description>&lt;P&gt;Hi i am trying to get graphic attribute on mouse click , below is my code. Kindly help.&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.esri.com/t5/user/viewprofilepage/user-id/204423" target="_blank" rel="noopener"&gt;@ErwinSoekianto&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to show username like the picture below it do not come from any feature layer but i have &lt;/P&gt;&lt;P&gt;to get it from private server to show, here on click&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-01-27 at 11.23.22 AM.png" style="width: 153px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4860iBB81C5B09BD0788E/image-dimensions/153x112?v=v2" width="153" height="112" role="button" title="Screenshot 2021-01-27 at 11.23.22 AM.png" alt="Screenshot 2021-01-27 at 11.23.22 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;so i tried like this and trying to get graphic- attribute or geometry, but it always come undefined, as i have to identify the graphic clicked and then get the username .&lt;/P&gt;&lt;PRE&gt;// *** declare mapview***//
    MapView {
        id:mapView
        property real initialMapRotation: 0
        Component.onCompleted: {
                mmpk.load();
            }
        anchors {
            left: parent.left
            right: parent.right
            top: parent.top
            bottom: parent.bottom
        }

        
        GraphicsOverlay{
            id:hunterfreindPathOverlay
        }
        //! [show callout qml api snippet]
        // initialize Callout
        calloutData {
            location: calloutLocation
            detail: "LINZ USER"
        }

        Callout {
            id: callout
            calloutData: parent.calloutData
            leaderPosition: leaderPositionEnum.Automatic
        }
        //! [show callout qml api snippet]

        // display callout on mouseClicked
        onMouseClicked: {
            const tolerance = 22;
            const returnPopupsOnly = false;
            const maximumResults = 1;

            if (callout.calloutVisible)
                callout.dismiss()
            else
            {             
       mapView.identifyGraphicsOverlayWithMaxResults(hunterfreindPathOverlay, mouse.x, mouse.y, tolerance, returnPopupsOnly, maximumResults);
                calloutLocation = mouse.mapPoint;
            }
        }
        // Signal handler for identify graphics overlay
            onIdentifyGraphicsOverlayStatusChanged: {
                if (identifyGraphicsOverlayStatus === Enums.TaskStatusCompleted) {
                    if (identifyGraphicsOverlayResult.graphics.length &amp;gt; 0) {
console.log("===&amp;gt;"+identifyGraphicsOverlayResult.graphics.geometry);
console.log("===&amp;gt;"+identifyGraphicsOverlayResult.graphics.attribute);
                        callout.accessoryButtonHidden = true;
                        callout.showCallout();
                    }
                } else if (identifyGraphicsOverlayStatus === Enums.TaskStatusErrored) {
                    console.log("error");
                }
            }
                //! [identify graphics api snippet]
    }//End Mapview&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;So i tried to add attribute like this and trying to fetch it, but unsuccessful&lt;/P&gt;&lt;PRE&gt;     // *** Create  graphic for boundaries and markers ***//
    function createGraphic(geometry, symbol) {
        var graphic = ArcGISRuntimeEnvironment.createObject("Graphic");
        graphic.geometry = geometry;
        graphic.symbol = symbol;
        graphic.attributes.insertAttribute("username", "LINZs");

        return graphic;
    }//end createGraphic&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2021 07:00:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/get-and-put-graphic-attribute-on-mouseclick-of-a/m-p/1021407#M3778</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2021-01-29T07:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: get and put graphic attribute on mouseclick of a particular overlay</title>
      <link>https://community.esri.com/t5/arcgis-appstudio-questions/get-and-put-graphic-attribute-on-mouseclick-of-a/m-p/1022014#M3779</link>
      <description>&lt;LI-CODE lang="markup"&gt;     // *** Create  graphic for boundaries and markers ***//
    function createGraphic(geometry, symbol, uname) {
        var graphic = ArcGISRuntimeEnvironment.createObject("Graphic");
        graphic.geometry = geometry;
        graphic.symbol = symbol;
        graphic.attributes.attributesJson = {name: uname};
        return graphic;
    }//end createGraphic&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; // Signal handler for identify graphics overlay
            onIdentifyGraphicsOverlayStatusChanged: {
                if (identifyGraphicsOverlayStatus === Enums.TaskStatusCompleted) {
                    if (identifyGraphicsOverlayResult.graphics.length &amp;gt; 0) {
                        console.log(JSON.stringify(identifyGraphicsOverlayResult.graphics[0].attributes.attributeValue("name")));
                       calloutData.detail=identifyGraphicsOverlayResult.graphics[0].attributes.attributeValue("name");
                       callout.accessoryButtonHidden = true;
                       callout.showCallout();
                    }
                } else if (identifyGraphicsOverlayStatus === Enums.TaskStatusErrored) {
                    console.log("error");
                }
            }&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 Feb 2021 06:38:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-appstudio-questions/get-and-put-graphic-attribute-on-mouseclick-of-a/m-p/1022014#M3779</guid>
      <dc:creator>rsharma</dc:creator>
      <dc:date>2021-02-01T06:38:13Z</dc:date>
    </item>
  </channel>
</rss>

