Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5928553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:18:19+00:00 2026-05-22T14:18:19+00:00

im trying to use google Map in my android application. I have added two

  • 0

im trying to use google Map in my android application.

I have added two permission for user :INTERNET and ACCESS_FINE_LOCATION”
and also :
“uses-library android:name=”com.google.android.maps”
here is my activity for showing the map:

public class SportEventActivity extends MapActivity {
    private MapController mapController;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.sportevent);
        Bundle extras = getIntent().getExtras();
        if (extras != null) {
            // Reads the parameters to this view
            String sportName = extras.getString(Utility.SPORT_NAME);
            String venueName = extras.getString(Utility.VENUE_NAME);
            String startDate = extras.getString(Utility.START_DATE);
            String endDate = extras.getString(Utility.END_DATE);
            final String latitude = extras.getString(Utility.LATITUDE);
            final String longitude = extras.getString(Utility.LONGITUDE);   
            TextView text1 = (TextView) findViewById(R.id.sedSportName);
            text1.setText("Sport: " + sportName);
            TextView text2 = (TextView) findViewById(R.id.sedVenue);
            text2.setText("Venue: " + venueName);
            TextView text3 = (TextView) findViewById(R.id.sedStartDate);
            text3.setText("Start date: " + startDate);
            TextView text4 = (TextView) findViewById(R.id.sedEndDate);
            text4.setText("End date: " + endDate);
            MapView mapView = (MapView) findViewById(R.id.mapview2);
            mapView.setBuiltInZoomControls(true);
            mapView.setStreetView(true);
            this.mapController = mapView.getController();
            this.mapController.setZoom(16);
            Double lat = getCoordinate(latitude) * 1E6;
            Double lng = getCoordinate(longitude) * 1E6;
            mapController.setCenter(new GeoPoint(lat.intValue(), lng.intValue()));

        }
    }

    @Override
    protected boolean isRouteDisplayed() {
        return false;
    }

    private Double getCoordinate(String coordinate) {
        return Double.parseDouble(coordinate);
    }
}

and also you can find the layout code related to this activity :

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:stretchColumns="1" android:id="@+id/sedLayout">

    <TableRow>
    </TableRow>

    <TableRow>
        <TextView android:layout_column="1" android:padding="3dip"
            android:text="Sport name" android:id="@+id/sedSportName" />
        <TextView android:gravity="right" android:padding="3dip" />
    </TableRow>

    <TableRow>
        <TextView android:layout_column="1" android:padding="3dip"
            android:text="Venue" android:id="@+id/sedVenue" />
        <TextView android:gravity="right" android:padding="3dip" />
    </TableRow>

    <TableRow>
        <TextView android:padding="3dip" />
        <TextView android:padding="3dip" android:text="Start Date"
            android:id="@+id/sedStartDate" />
    </TableRow>

    <TableRow>
        <TextView android:padding="3dip" />
        <TextView android:padding="3dip" android:text="End Date"
            android:id="@+id/sedEndDate" />
        <TextView android:gravity="right" android:padding="3dip" />
    </TableRow>
    <TableRow>
        <TextView android:padding="3dip" />
        <View android:layout_height="2dip" android:background="#FF909090" />        
        <TextView android:padding="3dip" />
    </TableRow>

    <TableRow>
    </TableRow>
    <com.google.android.maps.MapView
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/mapview2" android:layout_width="fill_parent"
            android:layout_height="fill_parent" android:clickable="true"            
            android:apiKey="0aULnfycQonb-l_B1QlcK8u4POo4_oKjnmqMU1Q" />
</TableLayout>

I can see the map, but the problem is that when I see the map, it show one chess chart on the map. I have attached a screenshot form the result. if any body why it show me the map with a borders, please give me a solution.

here is the screen shot of

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:18:20+00:00Added an answer on May 22, 2026 at 2:18 pm


    I think this is because you are inflating the mapview inside your TableLayout (but outside a TableRow). I would wrap the whole thing in a vertically oriented RelativeLayout, put the TableLayout first and then the mapview second.

    I have duplicated your layout exactly and haven’t had the problem you are seeing. The only difference is the coordinates I am centering the map with:

    m_mapView = (MapView) findViewById(R.id.mapview);
    m_mapView.setBuiltInZoomControls(true);
    m_mapView.setClickable(true);
    
    m_mapView.setStreetView(true);
    m_mapController = m_mapView.getController();
    m_mapController.setZoom(16);
    m_mapController.setCenter(new GeoPoint((int)(47.975 * 1E6), (int)(17.056 * 1E6)));!
    

    If you post the coordinate string are parsing and passing into setCenter I can test if that is the problem. In which case it seems like a bug:

    screenshot

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use JSNI to display a Google Map within an Application.
I am trying to use the Google Map API- I've successfully managed to add
i am trying to use Google OAuth to import a user 's contacts. In
I have been trying to use the hibernate dialect for SQLite from http://code.google.com/p/hibernate-sqlite/ in
I am trying to use places api for google map on my website. As
I'm trying to make a Google map that updates a marker as a user's
I have a Google Map with some simple buttons added to pan to different
GOOGLE MAPS API V3 is what i'm trying to use. I have all the
I am trying to create a Google Maps application that has the map of
I am trying to use google maps inside a jquery mobile app. The map

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.