<?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: Adding OpenStreetMap to HelloWorld in 10.2.2 in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-openstreetmap-to-helloworld-in-10-2-2/m-p/155635#M1100</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The reason why the app runs when you comment out the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;mMapView.addLayer(tileLayer)&lt;/SPAN&gt;&lt;SPAN&gt; is that the &lt;/SPAN&gt;&lt;STRONG&gt;MapView&lt;/STRONG&gt;&lt;SPAN&gt;'s basemap is set in XML. Open up the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;/res/layout/main.xml&lt;/SPAN&gt;&lt;SPAN&gt; file and comment out all the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;mapoptions &lt;/SPAN&gt;&lt;SPAN&gt;parameters. Your XML should look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!-- MapView layout, including basemap layer, initial center point, and zoom level --&amp;gt; 
&amp;lt;com.esri.android.map.MapView 
&amp;nbsp; android:id="@+id/map" 
&amp;nbsp; android:layout_width="fill_parent" 
&amp;nbsp; android:layout_height="fill_parent" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can confirm that the url you provide resolves to &lt;/SPAN&gt;&lt;A href="http://b.tile.cloudmade.com/myKey/1/256" rel="nofollow noopener noreferrer" target="_blank"&gt;http://b.tile.cloudmade.com/myKey/1/256&lt;/A&gt;&lt;SPAN&gt; at runtime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I responded to your &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/91904/how-to-add-cloudmade-map-to-arcgis-android/92420#92420" rel="nofollow noopener noreferrer" target="_blank"&gt;GIS Stackexchange question&lt;/A&gt;&lt;SPAN&gt; as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 08:16:06 GMT</pubDate>
    <dc:creator>DanO_Neill</dc:creator>
    <dc:date>2021-12-11T08:16:06Z</dc:date>
    <item>
      <title>Adding OpenStreetMap to HelloWorld in 10.2.2</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-openstreetmap-to-helloworld-in-10-2-2/m-p/155634#M1099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, I want to add an OpenStreetMap tile service layer to the Esri Android &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/android/guide/hello-world.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;HelloWorld&lt;/A&gt;&lt;SPAN&gt; app. I'm following the OpenStreetMap documentation &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/osm/OpenStreetMapLayer.html#OpenStreetMapLayer%28%29" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;. Find the relevant code below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public class HelloWorld extends Activity {
&amp;nbsp; MapView mMapView;

&amp;nbsp; // Called when the activity is first created.
&amp;nbsp; @Override
&amp;nbsp; public void onCreate(Bundle savedInstanceState) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; super.onCreate(savedInstanceState);
&amp;nbsp;&amp;nbsp;&amp;nbsp; setContentView(R.layout.main);
&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView = (MapView)findViewById(R.id.map);
&amp;nbsp;&amp;nbsp;&amp;nbsp; String[] tileServerURL = {"http://b.tile.cloudmade.com/{KEY}/1/256"};
&amp;nbsp;&amp;nbsp;&amp;nbsp; OpenStreetMapLayer tileLayer = new OpenStreetMapLayer(tileServerURL, 1, 16, "CloudMade", true);
&amp;nbsp;&amp;nbsp;&amp;nbsp; tileLayer.setKey("myKey"); 
 
&amp;nbsp;&amp;nbsp;&amp;nbsp; mMapView.addLayer(tileLayer); //when this line is commented out the app runs just fine&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LogCat gives an EsriServiceException and the app closes when I include the code above in the app. I'm probably missing something minor? Can someone clue me in? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks! Patty&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:16:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-openstreetmap-to-helloworld-in-10-2-2/m-p/155634#M1099</guid>
      <dc:creator>PattyJula</dc:creator>
      <dc:date>2021-12-11T08:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding OpenStreetMap to HelloWorld in 10.2.2</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-openstreetmap-to-helloworld-in-10-2-2/m-p/155635#M1100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The reason why the app runs when you comment out the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;mMapView.addLayer(tileLayer)&lt;/SPAN&gt;&lt;SPAN&gt; is that the &lt;/SPAN&gt;&lt;STRONG&gt;MapView&lt;/STRONG&gt;&lt;SPAN&gt;'s basemap is set in XML. Open up the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;/res/layout/main.xml&lt;/SPAN&gt;&lt;SPAN&gt; file and comment out all the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;mapoptions &lt;/SPAN&gt;&lt;SPAN&gt;parameters. Your XML should look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;!-- MapView layout, including basemap layer, initial center point, and zoom level --&amp;gt; 
&amp;lt;com.esri.android.map.MapView 
&amp;nbsp; android:id="@+id/map" 
&amp;nbsp; android:layout_width="fill_parent" 
&amp;nbsp; android:layout_height="fill_parent" /&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can confirm that the url you provide resolves to &lt;/SPAN&gt;&lt;A href="http://b.tile.cloudmade.com/myKey/1/256" rel="nofollow noopener noreferrer" target="_blank"&gt;http://b.tile.cloudmade.com/myKey/1/256&lt;/A&gt;&lt;SPAN&gt; at runtime.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I responded to your &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/91904/how-to-add-cloudmade-map-to-arcgis-android/92420#92420" rel="nofollow noopener noreferrer" target="_blank"&gt;GIS Stackexchange question&lt;/A&gt;&lt;SPAN&gt; as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 08:16:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/adding-openstreetmap-to-helloworld-in-10-2-2/m-p/155635#M1100</guid>
      <dc:creator>DanO_Neill</dc:creator>
      <dc:date>2021-12-11T08:16:06Z</dc:date>
    </item>
  </channel>
</rss>

