Hello, in my MapView, getLatitudeSpan is returning 0, and
getLongitudeSpan is returning 360,000,000. Similarly, getHeight,
getWidth and any other get[Pixel] method is returning 0. How am I
improperly setting up my code?

XML:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:id="@+id/map_view_main"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <com.google.android.maps.MapView
        android:id="@+id/map_view"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="map"
        />
</LinearLayout>

Code:
public class SampleMap extends MapActivity{
        MapView map_view = null;
        private String DEBUG_TAG = "MapView";

        public void onCreate(Bundle icicle){
                super.onCreate(icicle);

                setContentView(R.layout.map_view);
                map_view = (MapView) findViewById(R.id.map_view);

                Log.d(DEBUG_TAG, "bottom: " + map_view.getBottom());
                Log.d(DEBUG_TAG, "map Height: " + map_view.getHeight());
                Log.d(DEBUG_TAG, "map Width: " + map_view.getWidth());
                Log.d(DEBUG_TAG, "latitude span: " +
map_view.getLatitudeSpan());
                Log.d(DEBUG_TAG, "longtitude span: " +
map_view.getLongitudeSpan());
        }
}

Aside from getLongitudeSpan, every method called in Log.d returns 0.

--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to