The zoom may be deferred if the MapView hasn't been drawn yet.  Have you
tried putting your logic in a Runnable and post()ing it to the MapView?

Steve

On Sun, Aug 29, 2010 at 7:18 PM, Chad McQuillen <chad.mcquil...@gmail.com>wrote:

> My application has a MapView which shows a collection of items in a
> satellite view.  I use the MapController's zoomToSpan() method to
> initialize the zoom level of MapView.  I later discovered that the
> MapView was showing a blank white screen with grey X's (zoom'd too
> far, zoom out once and everything looks as expected) for the use case
> when the collection of item's locations were very close to each
> other.  So, I modified the code from this:
>
> mapController.zoomToSpan(latitudeDelta, longitudeDelta);
>
> to this:
>
> mapController.zoomToSpan(latitudeDelta, longitudeDelta);
>
> if (mapView.getZoomLevel() > mapView.getMaxZoomLevel()) {
>        mapController.setZoom(mapView.getMaxZoomLevel());
> }
>
> but, I still got the same result.  I added some debug before and after
> the zoomToSpan() to retrieve the zoom level from MapView and noticed
> that the zoom level did not change.  I'm guessing somehow that the
> work is queued up??
>
> I don't know if this information is important or not to this problem,
> but I'll also mention that the MapView is created from a MapActivity
> which is hosted in the tab host of a TabActivity that contains three
> tabs, one of which is the map.  I searched this forum and elsewhere
> and haven't seen anyone encounter such a problem before.  I'm hoping
> someone can point me in the right direction.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to