SKT
SKT

Reputation: 253

Map is not showing?

I am using nutiteq map,I have made an example simple hello map that is working fine,but when I apply cloude made map then map is not showing my code is as:-

public class EastWoodLogin extends Activity {
private BasicMapComponent mapComponent;
private String userid="";

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.eastwoodlogin);
    Log.enableAll();
    Log.setLogger(new AndroidLogger("myapp"));

    mapComponent = new BasicMapComponent("tutorial", new AppContext(this),
            1, 1, new WgsPoint(28.635308000000000000,77.224960000000010000), 10);
     //mapComponent.setMap(OpenStreetMap.MAPNIK);//when use this work fine

 // userId for CloudMade token auth
    TelephonyManager telephonyMgr = (TelephonyManager)
    this.getSystemService(Context.TELEPHONY_SERVICE);
    this.userid = telephonyMgr.getSubscriberId();

  mapComponent.setMap(new CloudMade("0edfc04001d84f2d98fef6e9744241cf", userid, 256, 1));// when use this map is not showing
    mapComponent.setPanningStrategy(new ThreadDrivenPanning());
    mapComponent.startMapping();

    // get the mapview that was defined in main.xml
    MapView mapView = (MapView) findViewById(R.id.mapview);

    // mapview requires a mapcomponent
    mapView.setMapComponent(mapComponent);

    ZoomControls zoomControls = (ZoomControls) findViewById(R.id.zoomcontrols);
    // set zoomcontrols listeners to enable zooming
    zoomControls.setOnZoomInClickListener(new View.OnClickListener() {
        public void onClick(final View v) {
            mapComponent.zoomIn();
        }
    });
    zoomControls.setOnZoomOutClickListener(new View.OnClickListener() {
        public void onClick(final View v) {
            mapComponent.zoomOut();
        }
    });

 // GPS Location
    final LocationSource locationSource = new AndroidGPSProvider(
   (LocationManager) getSystemService(Context.LOCATION_SERVICE), 1000L);
    Bitmap icon = BitmapFactory.decodeResource(getResources(),
            R.drawable.icon); 
   final LocationMarker marker = new NutiteqLocationMarker(new PlaceIcon(Image
                       .createImage(icon), icon.getWidth()/2, icon.getHeight()/2), 3000, true);
   locationSource.setLocationMarker(marker);
   mapComponent.setLocationSource(locationSource);


   mapComponent.addKmlService(new KmlUrlReader(
           "http://www.panoramio.com/panoramio.kml?LANG=en_US.utf8&", true));
}

}

please any one guide me where I am wrong thanks in advance.

Upvotes: 1

Views: 315

Answers (1)

JaakL
JaakL

Reputation: 4295

There is a bug in the version you use - it tries to make HTTP POST requests, but CloudMade does not accept them. Most other sources do not have this problem. Download fixed version from http://www.nutiteq.com/beta/lib/android_maps_lib-1.1.2a.jar , does it fix it?

Upvotes: 1

Related Questions