Adding Overlay Items very slow

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

Adding Overlay Items very slow

Postby an1st » Sat Feb 20, 2010 5:03 am

hey im beginner of android programming

I install android 2.1 and google API API7

i create my AVD in eclipse

name ... , target = Google APIs ( Google Inc. ) - API level 7

and no hardware setting.

and i coding some html Parsing program and

pased data show marker on google map.

i run my program . and result is so slow. and program show me the message

Sorry!
Activity GoogleMaps ( in application GoogleMaps) is not responding.
Enforce close wait

and map is not moving by dragging.
and program reshow the that Message.

im cry... T.T why is so late...
and if you have the solution to this problems. tell me .. T.T

following is some part of program source

i refer to developer.android.com > resource > Hello views > Google Mapview >

i display approximately 15 makers to the map.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void ShowMaps( List<FoodHouseMainInfo> fhmiList )
  2.     {  
  3.         List<Overlay> mapOverlays = mapView.getOverlays();
  4.         Drawable drawable = this.getResources().getDrawable(R.drawable.androidmarker);
  5.        
  6.         FoodMakerOverlay itemizedoverlay = new FoodMakerOverlay(drawable);//, getApplicationContext() );
  7.        
  8.        
  9.         for( int i = 0 ; i < fhmiList.size() ; i++ )
  10.         {
  11.                 FoodHouseMainInfo fhmi = fhmiList.get( i );
  12.                 String address = fhmi.GetAddress();
  13.        
  14.                 List<Address> foundAddresses = null;
  15.                
  16.                
  17.                 try {
  18.                                 foundAddresses = gc.getFromLocationName( address , 1 );
  19.                        
  20.                         if( foundAddresses.size() == 0 )
  21.                         {
  22.                                
  23.                         }
  24.                         else
  25.                         {
  26.                                 Address x = foundAddresses.get( 0 );
  27.                                         Double lat = x.getLatitude()* 1000000;
  28.                                         Double lon = x.getLongitude()* 1000000;
  29.                                         GeoPoint point = new GeoPoint( lat.intValue() ,lon.intValue());
  30.                                 OverlayItem overlayitem = new OverlayItem(point, "Hola, Mundo!", "I'm in Mexico City!");
  31.                                 itemizedoverlay.addOverlay(overlayitem);
  32.                                 mapOverlays.add(itemizedoverlay);
  33.                         }
  34.                         } catch (IOException e) {                                      
  35.                                         e.printStackTrace();
  36.                                 }
  37.                
  38.         }
  39.     }
  40.  
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
an1st
Once Poster
Once Poster
 
Posts: 1
Joined: Sat Feb 20, 2010 4:38 am

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests