pattyjula

Adding OpenStreetMap to HelloWorld in 10.2.2

Discussion created by pattyjula on Mar 30, 2014
Latest reply on Apr 8, 2014 by doneill-esristaff
Hello, I want to add an OpenStreetMap tile service layer to the Esri Android HelloWorld app. I'm following the OpenStreetMap documentation here. Find the relevant code below:

public class HelloWorld extends Activity {
  MapView mMapView;

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    mMapView = (MapView)findViewById(R.id.map);
    String[] tileServerURL = {"http://b.tile.cloudmade.com/{KEY}/1/256"};
    OpenStreetMapLayer tileLayer = new OpenStreetMapLayer(tileServerURL, 1, 16, "CloudMade", true);
    tileLayer.setKey("myKey"); 
 
    mMapView.addLayer(tileLayer); //when this line is commented out the app runs just fine


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?

Thanks! Patty

Outcomes