<?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 Make graphics clickable instead of create new graphics in map in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/make-graphics-clickable-instead-of-create-new/m-p/574275#M3910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I have a map with a MapOnTouchListener on it. I have overriden the OnSingleTap method (allPoints is an array where all markers are added for a non related to this question functionality):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Override public boolean onSingleTap(MotionEvent point) {&lt;/P&gt;&lt;P&gt;Point mapPoint=view.toMapPoint(point.getX(), point.getY());&lt;/P&gt;&lt;P&gt;new GeocoderAsynckTask(mapPoint,view).execute(mapPoint);&lt;/P&gt;&lt;P&gt;SpatialReference sp = SpatialReference.create(SpatialReference.WKID_WGS84);&lt;/P&gt;&lt;P&gt;Point p1Done=(Point) GeometryEngine.project(mapPoint, mvHelper.getMapView().getSpatialReference(), sp); allPoints.add(p1Done);&lt;/P&gt;&lt;P&gt;return super.onSingleTap(point);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That GeoCoderAsyncTask translates the coords of the point to an address, and adds a marker to the map. The geocoding is done just right, I get my address and in PostExecute method I add the marker to the map:&lt;/P&gt;&lt;P&gt;protected void onPostExecute(String address) {&lt;/P&gt;&lt;P&gt;mProgressDialog.dismiss();&lt;/P&gt;&lt;P&gt;Toast.makeText(ctx,address,Toast.LENGTH_LONG).show();&lt;/P&gt;&lt;P&gt;SpatialReference sp = SpatialReference.create(SpatialReference.WKID_WGS84);&lt;/P&gt;&lt;P&gt;Point p1Done=(Point) GeometryEngine.project(point, mvHelper.getMapView().getSpatialReference(), sp); mvHelper.addMarkerGraphic(p1Done.getY(), p1Done.getX(), "Location", address, android.R.drawable.ic_menu_myplaces, null, false, 1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I want the markers to be clickable, but if I click them, another marker is added. I have tried to nullify the MapOnTouchListener, but that way, no marker is added, and no click on marker is detected...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I acomplish that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2018 08:16:07 GMT</pubDate>
    <dc:creator>DavidFernández_Arias</dc:creator>
    <dc:date>2018-09-05T08:16:07Z</dc:date>
    <item>
      <title>Make graphics clickable instead of create new graphics in map</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/make-graphics-clickable-instead-of-create-new/m-p/574275#M3910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I have a map with a MapOnTouchListener on it. I have overriden the OnSingleTap method (allPoints is an array where all markers are added for a non related to this question functionality):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Override public boolean onSingleTap(MotionEvent point) {&lt;/P&gt;&lt;P&gt;Point mapPoint=view.toMapPoint(point.getX(), point.getY());&lt;/P&gt;&lt;P&gt;new GeocoderAsynckTask(mapPoint,view).execute(mapPoint);&lt;/P&gt;&lt;P&gt;SpatialReference sp = SpatialReference.create(SpatialReference.WKID_WGS84);&lt;/P&gt;&lt;P&gt;Point p1Done=(Point) GeometryEngine.project(mapPoint, mvHelper.getMapView().getSpatialReference(), sp); allPoints.add(p1Done);&lt;/P&gt;&lt;P&gt;return super.onSingleTap(point);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That GeoCoderAsyncTask translates the coords of the point to an address, and adds a marker to the map. The geocoding is done just right, I get my address and in PostExecute method I add the marker to the map:&lt;/P&gt;&lt;P&gt;protected void onPostExecute(String address) {&lt;/P&gt;&lt;P&gt;mProgressDialog.dismiss();&lt;/P&gt;&lt;P&gt;Toast.makeText(ctx,address,Toast.LENGTH_LONG).show();&lt;/P&gt;&lt;P&gt;SpatialReference sp = SpatialReference.create(SpatialReference.WKID_WGS84);&lt;/P&gt;&lt;P&gt;Point p1Done=(Point) GeometryEngine.project(point, mvHelper.getMapView().getSpatialReference(), sp); mvHelper.addMarkerGraphic(p1Done.getY(), p1Done.getX(), "Location", address, android.R.drawable.ic_menu_myplaces, null, false, 1);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, I want the markers to be clickable, but if I click them, another marker is added. I have tried to nullify the MapOnTouchListener, but that way, no marker is added, and no click on marker is detected...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I acomplish that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2018 08:16:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/make-graphics-clickable-instead-of-create-new/m-p/574275#M3910</guid>
      <dc:creator>DavidFernández_Arias</dc:creator>
      <dc:date>2018-09-05T08:16:07Z</dc:date>
    </item>
  </channel>
</rss>

