<?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 Adding a graphic on a spefisific location on the map in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326934#M2151</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Below is the part of the application code that I've written. When the application is run, the graphic is added on the map. Hovewer, it is not in the right location though the lattitude and longitude values are right. What could be the reason? I could not figure it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; someGraphicsLayer = new GraphicsLayer();
&amp;nbsp; map.addLayer(someGraphicsLayer);

&amp;nbsp; HashMap&amp;lt;String, Object&amp;gt; attrMap = new HashMap&amp;lt;String, Object&amp;gt;();
&amp;nbsp; attrMap.put("Title", "a graphic");

&amp;nbsp; double locx = 32.039821;
&amp;nbsp; double locy = 39.8858262;
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point p = new Point(locx, locy);
&amp;nbsp; Point point = (Point) GeometryEngine.project(p, SpatialReference.create(4326), map.getSpatialReference());&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp; Symbol symbol = someIcon;

&amp;nbsp; someGraphicsLayer.addGraphic(new Graphic(point, symbol, attrMap, null));
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jan 2012 07:36:45 GMT</pubDate>
    <dc:creator>_lkerArg_n</dc:creator>
    <dc:date>2012-01-18T07:36:45Z</dc:date>
    <item>
      <title>Adding a graphic on a spefisific location on the map</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326934#M2151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Below is the part of the application code that I've written. When the application is run, the graphic is added on the map. Hovewer, it is not in the right location though the lattitude and longitude values are right. What could be the reason? I could not figure it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; someGraphicsLayer = new GraphicsLayer();
&amp;nbsp; map.addLayer(someGraphicsLayer);

&amp;nbsp; HashMap&amp;lt;String, Object&amp;gt; attrMap = new HashMap&amp;lt;String, Object&amp;gt;();
&amp;nbsp; attrMap.put("Title", "a graphic");

&amp;nbsp; double locx = 32.039821;
&amp;nbsp; double locy = 39.8858262;
&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point p = new Point(locx, locy);
&amp;nbsp; Point point = (Point) GeometryEngine.project(p, SpatialReference.create(4326), map.getSpatialReference());&amp;nbsp;&amp;nbsp;&amp;nbsp; 

&amp;nbsp; Symbol symbol = someIcon;

&amp;nbsp; someGraphicsLayer.addGraphic(new Graphic(point, symbol, attrMap, null));
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 07:36:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326934#M2151</guid>
      <dc:creator>_lkerArg_n</dc:creator>
      <dc:date>2012-01-18T07:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a graphic on a spefisific location on the map</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326935#M2152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;mggl (sorry your name is not readable "?lker"),&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;seems like you need to refresh graphics layer, after graphics is added:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;graphicsLayer.postInvalidate();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developer.android.com/guide/topics/ui/how-android-draws.html"&gt;How Android Draws&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developer.android.com/reference/android/view/View.html#postInvalidate()"&gt;postInvalidate()&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 07:55:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326935#M2152</guid>
      <dc:creator>IvanBespalov</dc:creator>
      <dc:date>2012-01-18T07:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a graphic on a spefisific location on the map</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326936#M2153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;mggl (sorry your name is not readable "?lker"),&lt;BR /&gt;&lt;BR /&gt;seems like you need to refresh graphics layer, after graphics is added:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;graphicsLayer.postInvalidate();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developer.android.com/guide/topics/ui/how-android-draws.html"&gt;How Android Draws&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developer.android.com/reference/android/view/View.html#postInvalidate()"&gt;postInvalidate()&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Graphic is already seen on the map, but in the wrong place. The graphic is always seen at position ( lattitude = 0, longitude = 0) It turned out that the problem was map is not loaded. Thus, I added and asynchronus task which loops until the map is loaded and then adds the graphic later.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, thanks for the answer, I should add that line of code, too.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jan 2012 10:13:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326936#M2153</guid>
      <dc:creator>_lkerArg_n</dc:creator>
      <dc:date>2012-01-18T10:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a graphic on a spefisific location on the map</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326937#M2154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Instead of using an asynchronous task you can do something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mapView.setOnStatusChangedListener(new OnStatusChangedListener() {
public void onStatusChanged(Object source, STATUS status) {

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (status == STATUS.INITIALIZED) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:29:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-a-graphic-on-a-spefisific-location-on-the/m-p/326937#M2154</guid>
      <dc:creator>SebastianGreifeneder1</dc:creator>
      <dc:date>2021-12-11T15:29:56Z</dc:date>
    </item>
  </channel>
</rss>

