I think I know why, in order for this to work, I'd have to add the
items to an overlay everytime draw() is called, or else I can't draw
them, and this is going to interrupt the addition of the stations
because draw() is called numerous times in a short span of time.
Here's my method to add the new items, this method is called from
draw(), checkDrawableBounds verifies if it's in the drawable view.
What's the right way to be drawing these? Sorry for all the posts.

        public void showStations(GeoPoint[] stations) {
                for (int i = 0; i < stations.length; i++) {
                        Log.w("GOOD?",
String.valueOf(this.checkDrawableBounds(stations[i])));
                        if (this.checkDrawableBounds(stations[i])) {
                                //OverlayItem overlayitem = new 
OverlayItem(stations[i], "test",
"test");
                                //itemizedOverlay.addOverlay(overlayitem);
                        }
                }

                mapOverlays.add(itemizedOverlay);
        }

On Feb 11, 3:50 am, aspekt9 <[email protected]> wrote:
> Also, another issue I'm having, I can detect which points should be
> drawn in the view, but when I go to draw those points I call a method
> from the draw() method and I get a concurrent operation error:
>
> 02-11 03:47:11.848: ERROR/AndroidRuntime(2213):
> java.util.ConcurrentModificationException
> 02-11 03:47:11.848: ERROR/AndroidRuntime(2213):     at
> java.util.AbstractList$SimpleListIterator.next(AbstractList.java:66)
> 02-11 03:47:11.848: ERROR/AndroidRuntime(2213):     at
> com.google.android.maps.OverlayBundle.draw(OverlayBundle.java:41)
> 02-11 03:47:11.848: ERROR/AndroidRuntime(2213):     at
> com.google.android.maps.MapView.onDraw(MapView.java:476)
>
> It only does this when I call the method from the draw() method, but
> if I don't do that then I can't get the correct longitude and latitude
> coordinates, because they wont update unless they're called from
> draw(), if that makes sense.
>
> On Feb 11, 3:35 am, aspekt9 <[email protected]> wrote:
>
> > If I'm both drawing lines and utilizing items, would it be wise to
> > implement both a MapOverlay and a MapItemizedOverlay? Or do I just
> > need one?
>
> > On Feb 10, 4:55 pm, TreKing <[email protected]> wrote:
>
> > > On Wed, Feb 10, 2010 at 3:43 PM, aspekt9 <[email protected]> wrote:
> > > > What exactly is the span though,
>
> > > This is the distance between the locations demarcated by the edges of the
> > > screen. For longitude it's the distance between the locations at the left
> > > and right edges of the screen. For latitude it's the distance between the
> > > locations at the top and bottom of the screen.
>
> > > how would I calculate if a given
>
> > > > coordinate or geopoint lies in between the span?
>
> > > You have the mapview's current center location, yes?
> > > You have the longitude and latitude spans, yes?
> > > With that you can get 2 GeoPoints that represent the min and max points of
> > > the view. (center +/- (span / 2))
> > > With that you can check if a given GeoPoint lies within that min and max.
>
> > > -------------------------------------------------------------------------------------------------
> > > TreKing - Chicago transit tracking app for Android-powered 
> > > deviceshttp://sites.google.com/site/rezmobileapps/treking
>
>

-- 
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

Reply via email to