Why do not you try the open source Maps application, I re-wrote it again to help developers understand how the maps application works and extend it accordingly:
http://nader.shalabi.googlepages.com/androidapplications Regards On Thu, Sep 25, 2008 at 6:35 PM, andrex <[EMAIL PROTECTED]> wrote: > > Hi peter, i was trying use the code but i can't. I'll show you the > code of my class > > import android.graphics.Canvas; > import android.graphics.drawable.Drawable; > > import java.io.DataOutputStream; > import java.io.OutputStream; > import java.lang.reflect.Array; > import java.net.HttpURLConnection; > import java.net.URL; > import java.util.Vector; > import org.apache.http.protocol.HTTP; > import android.os.Bundle; > import android.view.*; > import com.google.android.maps.GeoPoint; > import com.google.android.maps.MapActivity; > import com.google.android.maps.MapView; > > > public class prueba extends MapActivity { > > MapView map; > GeoPoint Point = new GeoPoint((int) (-1.416402 * 1000000), (int) > (-78.025078 * 1000000)); > @Override > public void onCreate(Bundle savedInstanceState) { > super.onCreate(savedInstanceState); > setContentView(R.layout.main); > map = (MapView) findViewById(R.id.map); > map.getController().setCenter(Point); > // map.getController().animateTo(Point); > map.displayZoomControls(false); > map.getController().setZoom(7); > } > public boolean onKeyDown(int keyCode, KeyEvent event) { > switch(keyCode){ > case KeyEvent.KEYCODE_I: > int level = map.getZoomLevel(); > map.getController().setZoom(level + 1); > return true; > case KeyEvent.KEYCODE_O: > int level2 = map.getZoomLevel(); > map.getController().setZoom(level2 + 1); > return true; > case KeyEvent.KEYCODE_S: > map.setSatellite(true); > return true; > case KeyEvent.KEYCODE_T: > map.setSatellite(false); > return true; > } > return false; > } > > @Override > public boolean onCreateOptionsMenu(Menu menu) { > super.onCreateOptionsMenu(menu); > menu.add(0,1,2, "My Location"); > //menu 1 > SubMenu sub1 = menu.addSubMenu(3, 2, 3,"Vistas"); > sub1.add(3,3,1, "Satelite"); > sub1.add(3,4,2, "Trafico"); > //menu 2 > SubMenu sub = menu.addSubMenu(2, 5, 1,"Zoom"); > sub.add(2,6,1, "In"); > sub.add(2,7,2, "Out"); > return true; > } > @Override > public boolean onMenuItemSelected(int featureId, MenuItem item) { > super.onMenuItemSelected(featureId, item); > switch (item.getItemId()) { > case 1: > > return true; > case 3: > map.setSatellite(true); > return true; > case 4: > map.setSatellite(false); > return true; > case 6: > int level = map.getZoomLevel(); > map.getController().setZoom(level + 1); > return true; > case 7: > int level1 = map.getZoomLevel(); > map.getController().setZoom(level1 - 1); > return true; > } > return super.onOptionsItemSelected(item); > } > @Override > protected boolean isRouteDisplayed() { > // TODO Auto-generated method stub > return false; > } > } > > Over that map i want to draw some information, how i call a class > which extend of ItemizedOverlay. thanx for the help > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

