<?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: Move points and add attributes. in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691618#M4792</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're close, try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;HashMap&amp;lt;String, Object&amp;gt; hashMap = new HashMap&amp;lt;String, Object&amp;gt;();
hashMap.put("Title", title);
hashMap.put("BodyText", bodyText);
graphicsLayer.addGraphic(new Graphic(point, symbol, hashMap, null));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 05:06:39 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2021-12-12T05:06:39Z</dc:date>
    <item>
      <title>Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691615#M4789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a sample that shows how to move points in a graphics layer and display the attributes?&amp;nbsp; The Graphic object does not have an onClickListener or anything else that allows you to click a graphics.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2012 20:27:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691615#M4789</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2012-06-04T20:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691616#M4790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Brian, you can use the updateGraphic() method to move a graphic. Currently there is no move() method that lets you specify a distance since the updateGraphic() method is projection agnostic. Here's a link: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/com/esri/android/map/GraphicsLayer.html#updateGraphic(int" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgismobile/10.0/apis/android/api/com/esri/android/map/GraphicsLayer.html#updateGraphic(int&lt;/A&gt;&lt;SPAN&gt;, com.esri.core.geometry.Geometry)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to see how to create a point that's a certain distance away from a starting point, I have some JavaScript and Flex code that shows how to do that on the client. I haven't converted it to Java yet. If interested email me: agup at esri dot com.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The Nearby Sample shows how to use an OnSingleTapListener and then iterate through the graphics until you find the one with the correct ID: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgismobile/10.0/apis/android/help/index.html#//01190000002s000000" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/arcgismobile/10.0/apis/android/help/index.html#//01190000002s000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the pattern:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;int[] graphicIDs = graphicsLayer.getGraphicIDs(x, y, 25);
if (graphicIDs != null &amp;amp;&amp;amp; graphicIDs.length &amp;gt; 0) {
 //Graphic gr = graphics[0];
 Graphic gr = graphicsLayer.getGraphic(graphicIDs[0]);
 updateContent((String) gr.getAttributeValue("Rating"),
&amp;nbsp;&amp;nbsp; (String) gr.getAttributeValue("Title"));
 Point location = (Point) gr.getGeometry();
 callout.setOffset(0, -15);
 callout.show(location, content);
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691616#M4790</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-12-12T05:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691617#M4791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Andy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I add attributes to the graphics?&amp;nbsp; I am trying to do it this way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;HashMap&amp;lt;String, Object&amp;gt; map = new HashMap&amp;lt;String, Object&amp;gt;();
map.put("note", "");
graphicsLayer.updateGraphic(graphic.getUid(), map);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:06:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691617#M4791</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2021-12-12T05:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691618#M4792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're close, try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;HashMap&amp;lt;String, Object&amp;gt; hashMap = new HashMap&amp;lt;String, Object&amp;gt;();
hashMap.put("Title", title);
hashMap.put("BodyText", bodyText);
graphicsLayer.addGraphic(new Graphic(point, symbol, hashMap, null));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:06:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691618#M4792</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-12-12T05:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691619#M4793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am getting really close to what I am trying to do.&amp;nbsp; Is there a way to drag the points to move them and delete them?&amp;nbsp; Also, what are the coordinates that I get off of the geometry(point).&amp;nbsp; It is not the screen coordinates it looks like (1.845, 4800.00).&amp;nbsp; I somehow need to convert these coordinates to Web Mercator so that I can pull them from a SQLite DB and load them to a web application.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Jun 2012 19:25:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691619#M4793</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2012-06-08T19:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691620#M4794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are using a tiled map with spatial reference 102100, then the value you get back from the location variable in the following code snippet should be Web Mercator:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;Point location = (Point) gr.getGeometry();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Make sure you are seeing/using the raw numbers for x,y. I suspect you are just missing the "eX" portion of the number. Check them in the debugger and they should look like 1.888e7, where 1.888e7 = 18�??880�??000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know of any way to drag points at the moment with v1.1.1. One other option is you could listen for a long press and display a pop-up with an option to delete.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jun 2012 14:23:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691620#M4794</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2012-06-11T14:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691621#M4795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;but how do you select the point in the first place?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 11:32:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691621#M4795</guid>
      <dc:creator>MarkHorsell</dc:creator>
      <dc:date>2012-11-28T11:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691622#M4796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need to setup a listener on the graphics layer and then search for graphics in the touch radius using the getGraphicsIDs function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2012 13:55:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691622#M4796</guid>
      <dc:creator>BrianGustafson</dc:creator>
      <dc:date>2012-11-28T13:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691623#M4797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/448047"&gt;@Mark&lt;/a&gt;, To add to Brian's comment. As mentioned above, you can listen for a map event such as a setOnSingleTapListener and then get the graphic IDs from the graphic layer. The getGraphicsIDs() method is an overloaded method and you can find more information on it &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/android-sdk/api/com/esri/android/map/GraphicsLayer.html" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;. Once you have the graphic IDs you can either iterate through them and test for a certain condition, or just grab the first one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see an example of this code in the "Nearby" SDK sample. Here's the code snippet from that sample:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;map.setOnSingleTapListener(new OnSingleTapListener() {

 private static final long serialVersionUID = 1L;

 public void onSingleTap(float x, float y) {

&amp;nbsp; if(callout != null){
&amp;nbsp;&amp;nbsp; callout.hide();
&amp;nbsp; }
&amp;nbsp; else
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; callout = map.getCallout();
&amp;nbsp;&amp;nbsp; callout.setStyle(R.xml.calloutstyle);
&amp;nbsp; }
 
&amp;nbsp; int[] graphicIDs = graphicsLayer.getGraphicIDs(x, y, 25);
&amp;nbsp; if (graphicIDs != null &amp;amp;&amp;amp; graphicIDs.length &amp;gt; 0) {
&amp;nbsp;&amp;nbsp; Graphic gr = graphicsLayer.getGraphic(graphicIDs[0]);
&amp;nbsp;&amp;nbsp; updateContent((String) gr.getAttributeValue("Rating"),
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (String) gr.getAttributeValue("Title"));
&amp;nbsp;&amp;nbsp; Point location = (Point) gr.getGeometry();
&amp;nbsp;&amp;nbsp; callout.setOffset(0, -15);
&amp;nbsp;&amp;nbsp; callout.show(location, content);
&amp;nbsp; }
&amp;nbsp; 
 }
});&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:06:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691623#M4797</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2021-12-12T05:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691624#M4798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Many thanks for replying, however i'm not sure this is useful to me!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to interrogate a ArcGISDynamicMapServiceLayer and am using query as per the attributeEditor sample. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do i need to abandon that approach? If i used this approach does that mean i have to have all the features of a map loaded into graphics at all times? Doesn't that make dynamicMapServiceLayer redundant?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 07:57:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691624#M4798</guid>
      <dc:creator>MarkHorsell</dc:creator>
      <dc:date>2012-11-29T07:57:56Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691625#M4799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;@mark, hmmm...I'm not clear on what you are trying to accomplish. Can you please provide details on your requirements? And, what would you like to happen in the application once the touch listener event happens?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 16:12:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691625#M4799</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2012-11-29T16:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Move points and add attributes.</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691626#M4800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, i think i'm trying to achieve the same thing but i've gone about it in a very different way, trying to query the 'dynamic map service layer' instead of the graphics array. This causes an error but i'm not sure why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Point pointClicked;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pointClicked = mapView.toMapPoint(point.getX(), point.getY());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Query query = new Query();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.setOutFields(new String[] { "*" });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.setSpatialRelationship(SpatialRelationship.INTERSECTS);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.setMaxAllowableOffset(10);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Geometry geom=GeometryEngine.buffer(pointClicked,mapView.getSpatialReference(),100,null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.setGeometry(geom);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.setInSpatialReference(mapView.getSpatialReference());&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;query.setMaxAllowableOffset(100);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;shapesFeatureLayer.selectFeatures(query, ArcGISFeatureLayer.SELECTION_METHOD.NEW, new CallbackListener&amp;lt;FeatureSet&amp;gt;() {&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2012 07:30:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/move-points-and-add-attributes/m-p/691626#M4800</guid>
      <dc:creator>MarkHorsell</dc:creator>
      <dc:date>2012-11-30T07:30:57Z</dc:date>
    </item>
  </channel>
</rss>

