Sample of what? Deriving from the class and overriding a method should be pretty straightforward:
public class MyOverlay exntends Overlay { ... void draw(android.graphics.Canvas canvas, MapView mapView, boolean shadow) { // Logic to figure out where to draw // Use canvas to draw } ... } And at some point you add this to the mapview's overlays: MyOverlay mo = new MyOverlay(); mapView.getOverlays().add(mo); The draw call gets called for you when the map gets drawn. ------------------------------------------------------------------------------------------------- TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking On Wed, Jan 13, 2010 at 2:42 PM, Peter <pmcalen...@gmail.com> wrote: > Thanks... Any chance you could show a sample of that. I am new to > this and not real familiar with the coding approach. > -Pete > > On Jan 13, 1:19 pm, TreKing <treking...@gmail.com> wrote: > > Create a class derived from Overlay and override onDraw() to do your > custom > > drawing. > > > > > ------------------------------------------------------------------------------------------------- > > TreKing - Chicago transit tracking app for Android-powered deviceshttp:// > sites.google.com/site/rezmobileapps/treking > > > > > > > > On Wed, Jan 13, 2010 at 7:29 AM, Peter <pmcalen...@gmail.com> wrote: > > > Hi, > > > > > I am new to Android Dev and to this group. I wanted to do some work > > > with the MapView. Mostly some basic stuff like zooming to an address, > > > and the programatically drawing a shape (polygon) based on user input > > > of coordinates. Then i want to overlay that polygon on the google map > > > at the specified location. > > > > > Does anyone have some sample code for a polygon overlay? I went > > > through the MapView tutorial on the Android Dev site, and that was > > > great to get me started. But that uses a GeoPoint overlay... I guess > > > i am looking for more of a GeoPolygon (??) overlay, but i checked the > > > google api and there is no such class. > > > > > Any help or links to documentation to do this would be great. I am > > > guessing i need to great an android.graphics.drawable.shapes.shape to > > > create the polygon, and then add it to an OverlayItem from the google > > > maps API?? But i am very confused on how to do this. > > > > > Thanks! > > > > > Pete > > > > > -- > > > You received this message because you are subscribed to the Google > > > Groups "Android Beginners" group. > > > > > NEW! Try asking and tagging your question on Stack Overflow at > > >http://stackoverflow.com/questions/tagged/android > > > > > To unsubscribe from this group, send email to > > > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > <android-beginners%2bunsubscr...@googlegroups.com> > > > For more options, visit this group at > > >http://groups.google.com/group/android-beginners?hl=en- Hide quoted > text - > > > > - Show quoted text - > > -- > You received this message because you are subscribed to the Google > Groups "Android Beginners" group. > > NEW! Try asking and tagging your question on Stack Overflow at > http://stackoverflow.com/questions/tagged/android > > To unsubscribe from this group, send email to > android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com> > For more options, visit this group at > http://groups.google.com/group/android-beginners?hl=en > >
-- You received this message because you are subscribed to the Google Groups "Android Beginners" group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en